In a GitHub Actions CI/CD pipeline, what pattern ensures 'deploy to staging' always runs before 'deploy to production'?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Jobs run in parallel by default regardless of YAML order — 'needs:' is the only way to create a guaranteed sequential dependency.
Full explanation below image
Full Explanation
GitHub Actions jobs run concurrently by default — YAML order does not imply execution order. The 'needs:' keyword creates explicit job dependencies. 'needs: deploy-staging' in the deploy-production job means it won't start until deploy-staging completes successfully. This creates a sequential pipeline: build → deploy-staging → integration-test → deploy-production. 'priority:' is not a valid GitHub Actions job property. This pattern implements a deployment pipeline gate where staging must succeed before production can proceed.