Skip to content

Instantly share code, notes, and snippets.

@JonasGroeger
Last active September 20, 2022 14:37
Show Gist options
  • Save JonasGroeger/7f8e2d9453ae13d79d53f857730f1ec3 to your computer and use it in GitHub Desktop.
Save JonasGroeger/7f8e2d9453ae13d79d53f857730f1ec3 to your computer and use it in GitHub Desktop.
GitLab CI/CD: Staged Deployment (dev -> stage -> prod)
# When deploy-dev auto-deploys
# When deploy-dev succeeds, the (⏵) button for the deploy-stage stage shows up
# When deploy-dev fails, the (⏵) button for the deploy-stage stage does NOT show up
# Same for the deploy-prod stage
stages:
- deploy-dev
- deploy-test
- deploy-stage
deploy-dev:
stage: deploy-dev
environment: Development
script:
- env
deploy-stage:
stage: deploy-stage
environment: Staging
script:
- env
when: manual
needs:
- deploy-dev
deploy-prod:
stage: deploy-prod
environment: Production
script:
- env
when: manual
needs:
- deploy-stage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment