Every release goes straight to production, and nothing tries it first. A release should go to staging first, and to production only once staging is up.
Production gets the same image, the one the release tested: don't give it a docker build of its own. A second build makes a second image, which nobody tested.
staging:
needs: image
environment: staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: ./deploy.sh staging registry.monster.market/shop:${{ github.ref_name }}
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
production:
needs: stagingProduction's steps stay as they are.
Push it, and wait for CI to finish (gh run watch) before you release v1.1.0: CI deploys to staging too, and the deploy service takes one deploy at a time. The next lesson makes deploys wait their turn.
Objectives
- Staging first.
- The same image.