Full Workflow with Manual Approval for Deploy #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual Approval Deployment | |
# Manually triggered after CI Pipeline completes | |
on: | |
workflow_dispatch: # Allows for a manual trigger | |
# Optionally, you could set this to run automatically after a successful run of ci.yaml | |
# workflow_run: | |
# workflows: ["CI Pipeline"] | |
# types: | |
# - completed | |
jobs: | |
approval: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Approval Step | |
run: echo "Manual approval required before deployment." | |
- name: Wait for approval | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
// Simulate a pause until a user approves in the GitHub interface or by running a command. | |
deploy: | |
runs-on: ubuntu-latest | |
needs: approval | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Deploy to production | |
run: echo "Deploying to production..." |