Tagged Deploy #12
Workflow file for this run
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: Tagged Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Deploy environment' | |
type: environment | |
required: true | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check environment | |
run: | | |
if [[ "${{ github.event.inputs.environment }}" == "prod" ]]; then | |
echo "Cannot run this job with 'prod' environment" | |
exit 1 | |
fi | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get Tag | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
outputs: | |
version: ${{ steps.get_version.outputs.VERSION }} | |
wait_for_approval: | |
name: Wait for manual approval | |
needs: deploy | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ github.event.inputs.environment }} | |
steps: | |
- name: Wait for approval | |
run: echo "Deployment approved" | |
- name: Deploy ${{ needs.deploy.outputs.version }} to ${{ github.event.inputs.environment }} | |
run: echo "Deploy" |