From the course: Learning GitHub Actions
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Add dependencies between actions - GitHub Tutorial
From the course: Learning GitHub Actions
Add dependencies between actions
- [Instructor] If we consider our example workflow like a flow chart, we have two jobs that are run in parallel when the workflow is triggered by an event, like a push to the repository. But let's say, for example, that the first job produces some output that the second job needs as input. If they're running in parallel, the second job might fail without that input. So you might be wondering how do we get the first job to run before the second job? We can create that kind of dependency by adding the needs attribute to the second job. When we add the needs attribute to a job, we include the job ID of one or more jobs that must complete successfully before the job will run. Back in our workflow, if we add the needs attribute to job two and follow it by the identifier for job one, job two becomes dependent on job one. We can change our flow chart representation to show this dependency. Now, job one must complete…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Create a workflow3m 11s
-
(Locked)
Add jobs and steps to a workflow2m 36s
-
(Locked)
Add actions to a workflow4m 27s
-
(Locked)
Run a workflow2m 31s
-
(Locked)
Add dependencies between actions1m 50s
-
(Locked)
Add conditions to a workflow2m 40s
-
(Locked)
Workflow and action limitations1m 27s
-
(Locked)
Challenge: Develop a complex workflow1m 2s
-
(Locked)
Solution: Develop a complex workflow6m 18s
-
(Locked)
-
-
-
-