Update approvals.yaml #3
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: Deploy Workflow with Post-Build Approval | |
on: | |
push: | |
branches: | |
- approval | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
approval: | |
name: Manual Approval | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Build Artifact | |
run: echo "build artifacts" | |
- name: Wait for User Approval | |
id: approval | |
run: | | |
echo "Waiting for user approval through workflow_dispatch." | |
echo "Set 'approve_deployment' input to 'yes' or 'no'." | |
deploy: | |
name: Deploy to Production | |
runs-on: ubuntu-latest | |
needs: [approval] | |
if: ${{ github.event.inputs.approve_deployment == 'yes' }} | |
environment: | |
name: prod | |
steps: | |
- name: Deploy application | |
run: | | |
echo "Deploying application to production..." | |
# Add your deployment commands here |