-
Notifications
You must be signed in to change notification settings - Fork 26
70 lines (59 loc) · 2.04 KB
/
Copy pathdeploy-backend-dev.yml
File metadata and controls
70 lines (59 loc) · 2.04 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
61
62
63
64
65
66
67
68
69
70
name: Deploy Backend to App Runner (Dev)
on:
push:
branches: [ dev ]
paths:
- 'backend/**'
- '.github/workflows/deploy-backend-dev.yml'
workflow_dispatch: # Allow manual triggering
env:
AWS_REGION: us-east-1
SERVICE_NAME: tally-backend-dev
SSM_PREFIX: /tally-backend
SSM_ENV: dev
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev # Use the dev environment
permissions:
id-token: write # Required for OIDC
contents: read # Required to checkout code
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Sync Grafana API token to SSM
env:
GRAFANA_API_TOKEN: ${{ secrets.GRAFANA_API_TOKEN }}
run: |
if [ -z "$GRAFANA_API_TOKEN" ]; then
echo "::notice::GRAFANA_API_TOKEN secret is not set; leaving existing SSM parameter unchanged"
exit 0
fi
aws ssm put-parameter \
--name "${{ env.SSM_PREFIX }}/${{ env.SSM_ENV }}/grafana_api_token" \
--value "$GRAFANA_API_TOKEN" \
--type SecureString \
--overwrite \
--region "${{ env.AWS_REGION }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
- name: Deploy to App Runner
working-directory: ./backend
run: |
# Make the script executable
chmod +x deploy-apprunner-dev.sh
# Run deployment for dev environment
./deploy-apprunner-dev.sh
- name: Deployment Summary
run: |
echo "🎉 Backend DEV deployment initiated successfully!"
echo "Monitor progress in AWS App Runner console"
echo "Service: ${{ env.SERVICE_NAME }}"
echo "Environment: DEV"