forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-production.yml
More file actions
60 lines (52 loc) 路 1.63 KB
/
Copy pathdeploy-production.yml
File metadata and controls
60 lines (52 loc) 路 1.63 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
51
52
53
54
55
56
57
58
59
60
name: Deploy to Production
on:
workflow_dispatch:
inputs:
version:
description: 'Version/tag to deploy'
required: true
type: string
confirm:
description: 'Type "deploy" to confirm production deployment'
required: true
type: string
jobs:
validate:
name: Validate Deployment Input
runs-on: ubuntu-latest
steps:
- name: Check confirmation
run: |
if [ "${{ github.event.inputs.confirm }}" != "deploy" ]; then
echo "Deployment not confirmed. Aborting."
exit 1
fi
deploy-production:
name: Deploy to Production Environment
runs-on: ubuntu-latest
needs: validate
environment:
name: production
url: ${{ vars.PRODUCTION_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version }}
- name: Load production config
run: |
echo "ENVIRONMENT=production" >> $GITHUB_ENV
cat infrastructure/ci/deployment-configs/production.json
- name: Deploy application
run: echo "Deploying version ${{ github.event.inputs.version }} to production..."
env:
DEPLOY_ENV: production
API_URL: ${{ secrets.PROD_API_URL }}
DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}
- name: Run health checks
run: echo "Running production health checks..."
- name: Notify deployment
if: always()
run: |
STATUS="${{ job.status }}"
echo "Production deployment ${STATUS} for version ${{ github.event.inputs.version }}"