-
Notifications
You must be signed in to change notification settings - Fork 160
50 lines (45 loc) · 1.48 KB
/
Copy pathdeployment.yml
File metadata and controls
50 lines (45 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Safe Deployment
on:
workflow_dispatch:
inputs:
action:
description: Deployment action
required: true
type: choice
options: [deploy, rollback]
environment:
description: Protected GitHub environment to target
required: true
type: choice
options: [staging, production]
permissions:
contents: read
concurrency:
group: deployment-${{ inputs.environment }}
cancel-in-progress: false
jobs:
quality-gate:
name: Required Quality Gate
uses: ./.github/workflows/ci.yml
deploy:
name: ${{ inputs.action }} ${{ inputs.environment }}
needs: quality-gate
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Run deployment action
env:
STARFORGE_DEPLOY_ENVIRONMENT: ${{ inputs.environment }}
STARFORGE_DEPLOY_APPROVED: ${{ inputs.environment == 'production' && 'true' || '' }}
STARFORGE_ROLLBACK_APPROVED: ${{ inputs.environment == 'production' && 'true' || '' }}
STARFORGE_DEPLOY_COMMAND: ${{ secrets.STARFORGE_DEPLOY_COMMAND }}
STARFORGE_ROLLBACK_COMMAND: ${{ secrets.STARFORGE_ROLLBACK_COMMAND }}
STARFORGE_HEALTHCHECK_URL: ${{ secrets.STARFORGE_HEALTHCHECK_URL }}
run: |
if [ "${{ inputs.action }}" = "deploy" ]; then
bash scripts/ci-deploy.sh
else
bash scripts/ci-rollback.sh
fi