Member-only story
GitHub Actions 101: Deep Dive into Workflow Attributes
Beginner Series to Automating your Workflow with GitHub Actions! Part 2: Useful Attributes to Know
Hello and welcome to Part 2 of the GitHub Actions series. A series where we will walk through everything you need to know about GitHub Actions, from the basics to creating your own customized workflow.
If you have missed Part 1, please read it here before proceeding to Part 2.
In this part, let’s dive deeper into some attributes and useful things you need to know to customize a good workflow.
Job dependencies
Recap: Each workflow must have 1 job, each job has a unique identifier, they run in parallel by default.
As discussed in the previous part of this series, jobs are executed in parallel by default. In the example below, job1
and job2
will be run simultaneously.
jobs:
job1: # unique identifier
# job stuff here
job2: # unique identifier
# job stuff here
However, using the needs
attribute, we can ensure certain jobs to run based on another job.
Let’s take a look at an example:
jobs:
job1:
job2:
needs: job1
job3:
needs…