CI/CD Pipelines: Stages and Deployment Patterns/Staging then production promotion

Require staging verification before production deploy.

Section: Deployment strategy snippets

Staging then production promotion

yaml
yaml
jobs:
  deploy_staging:
    runs-on: ubuntu-latest
    steps:
      - run: ./scripts/deploy.sh staging

  smoke_test:
    needs: deploy_staging
    runs-on: ubuntu-latest
    steps:
      - run: ./scripts/smoke-test.sh https://staging.example.com

  deploy_production:
    needs: smoke_test
    runs-on: ubuntu-latest
    steps:
      - run: ./scripts/deploy.sh production
Explanation

Promotion pipelines reduce risk by proving the same build in staging before releasing to production.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Deployment strategy snippets
Manual production gate in GitLab
Add a human approval step before production deployment.
OpenIn sheetyamlsame section
Blue/green deploy flow
Switch traffic after health checks pass on the new environment.
OpenIn sheetbashsame section
Multi-stage GitHub Actions workflow
Separate lint, test, build, and deploy into distinct jobs.
GitLab stage ordering
Use explicit stages for predictable progression.
Always archive reports and clean up
Preserve artifacts even when the pipeline fails.