In this hands-on lab your will create environments and a staged deployment workflow with approvals.
This hands on lab is based on My first workflow and adds the following steps:
- Got to Settings | Environments and click New environment
- Enter the name
Staging
and clickConfigure environment
- Add yourself as the
Required reviewer
for this environment:
- Only allow the
main
branch to be deployed to this environment:
- Open your build/deploy workflow file and find the
deploy
job - In the depoloy job, add the yaml property
environment: staging
deploy:
runs-on: ubuntu-latest
needs: build
environment: staging
- Open the workflow run and start the review.
- And approve it with a comment:
- The result looks like this and contains the approval and the URL for the staging environment: