-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow for chaining jobs in github actions
- Loading branch information
1 parent
6f3a8c7
commit 0d03a32
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Chaining Jobs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
inputs: | ||
run-job-3: | ||
description: "Run job 3" | ||
type: boolean | ||
|
||
jobs: | ||
|
||
job-1: | ||
name: Job 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Output for Job 1 | ||
run: echo "Hello from Job 1. Run Job 3 equals ${{ github.event.inputs.run-job-3 }}" | ||
|
||
job-2: | ||
name: Job 2 | ||
runs-on: ubuntu-latest | ||
needs: | ||
- job-1 | ||
steps: | ||
- name: Output for Job 2 | ||
run: echo "Hello from Job 2" | ||
|
||
job-3: | ||
name: Job 3 | ||
if: github.event.inputs.run-job-3 == 'true' # if the input is false, this job would be skipped | ||
runs-on: ubuntu-latest | ||
needs: | ||
- job-1 | ||
steps: | ||
- name: Output for Job 3 | ||
run: echo "Hello from Job 3" | ||
|
||
job-4: | ||
name: Job 4 | ||
runs-on: ubuntu-latest | ||
# if: always() # Causes the job to always execute | ||
needs: | ||
- job-2 | ||
- job-3 | ||
steps: | ||
- name: Output for Job 4 | ||
run: echo "Hello from Job 4" |