top of page
Search
  • Writer's pictureNathan

GitHub Workflows - Advanced Basics

Updated: May 5

First, let's go over some high level basics of GitHub Workflows.



  • Each GitHub Workflow is made up of one or more Jobs.

  • Each Job is made up of one or more Steps.

  • There are 3 different types of Steps (see code below):

    • Steps that run a shell command

    • Steps that run a GitHub Action

    • Steps that run a Docker container (only supported on Linux runners)


 

Reusing Code in your Workflow



GitHub Workflows allow you to reuse units of code. You can do this at 2 different levels inside your Workflow (see code below):

  • You can reuse Job-level code by using Reusable Workflows

  • You can reuse Step-level code by using Actions


For both options, you can source the reused code from either:

  • A repo that is different than the repo that holds the workflow

  • The same repo that holds the workflow


 

Types of Actions


There are 3 different types of Actions:

  • An action that runs a Docker container (only supported on Linux runners)

  • An action that runs JavaScript (Node.js) code

  • An action that is a collection of one or more Steps (aka "Composite" action)


You can easily tell what kind of action is being used by looking at the repo for the action and examining the action.yml file.


 

Okay, I think that's good enough for a quick overview of some "advanced" basics of GitHub Workflows. If you would like to learn more and really get into the weeds with GitHub Workflows, then check out my GitHub Workflows Guide that I created.

89 views

Comentários


bottom of page