01_05-manual-approvals-and-environments
Use these files to test a manual deployment using environments protection rules.
Set up the Workflow
- Create a new repo.
- Add the files from this directory to the root of the new repo.
- Move the file
manual-approval.yml
into the.github/workflows
directory in the new repo. - Once the file is commited, the workflow should be triggered by a
push
event. - Confirm the workflow runs as expected and includes output for two jobs, development and production.
Add a Reviewer and a Manual Approval
- Modify the repo settings. Go to:
Settings
->Environments
->production
. - Select the check-box next to
Required reviewers
. - Add your username as a reviewer.
- Click
Save protection rules
.
Rerun the Workflow
- Go to the
Actions
tab and select the workflow. - Click the
Run workflow
drop-down and then click theRun workflow
button. - Open the workflow run that you just started (you may need to refresh the screen to see it).
- Note the message requesting a review.
- Click
Review deployments
- Clik the check-box next to
production
, add a comment, and clickApprove and deploy
. - Wait for the workflow to complete and review the output.