How do you handle approvals and deployments across environments in GitHub Actions?
IntermediateProductionGitHub Actions and GitLab CI in Production
Answer
Define environments staging and production. Staging has no reviewers and deploys on merge; production requires reviewers from a team (and prevents self-review), is limited to main, and has its own secrets/OIDC role. Chain jobs with needs so the same artifact digest flows through. Add a wait timer for a cooling-off period if needed.
jobs:
deploy-staging:
environment: staging
# ...
deploy-prod:
needs: deploy-staging
environment: production
# ...
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle required checks when workflows use path filters or matrices?AdvancedHow do you keep GitHub Actions workflow files themselves safe from unauthorised changes?Intermediate