top of page
Search
Writer's pictureNathan

GitHub Workflows - Advanced Basics

Updated: Dec 4, 2024

 

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



You can reuse code in your Workflow. You can do this at 2 different levels inside your Workflow (see code examples below):


  • You can reuse Job-level code by using a "Reusable Workflow"

  • You can reuse Step-level code by using an "Action"


For both options, you can pull 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.


 

Links



 

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.

144 views

Comments


bottom of page