Interview Prep/CI/CD/GitHub Actions and GitLab CI in Production

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
    # ...
All CI/CD questions Roadmap: GitLab CI/CD

More on GitHub Actions and GitLab CI in Production