GH-200 · Question #72
As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in…
The correct answer is D. workflow_run. A deployment workflow can be started after a build workflow has finished by using the workflow_run event in the deployment workflow's on trigger. You must specify the name of the build workflow you want to trigger on and use an if condition to ensure the deployment workflow…
Question
As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?
Options
- Arepository_dispatch
- Bworkflow_dispatch
- Cworkflow_exec
- Dworkflow_run
How the community answered
(54 responses)- A4% (2)
- B13% (7)
- C7% (4)
- D76% (41)
Explanation
A deployment workflow can be started after a build workflow has finished by using the workflow_run event in the deployment workflow's on trigger. You must specify the name of the build workflow you want to trigger on and use an if condition to ensure the deployment workflow only runs if the build workflow successfully completes. Here's how to set it up: In your deployment workflow file: (e.g., deploy.yml), define the on: trigger. Use the workflow_run event: within the on: trigger. Specify the build workflow: by its name. Add a conditional if statement: to the workflow to check the conclusion of the workflow_run event, ensuring it equals 'success'. https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
Topics
Community Discussion
No community discussion yet for this question.