Repository navigation
64 lines (54 loc) · 2.23 KB
/
Copy pathdeploy.yml
File metadata and controls
64 lines (54 loc) · 2.23 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
name: Deploy to Production
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push API image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/axiom-api:$IMAGE_TAG .
docker push $ECR_REGISTRY/axiom-api:$IMAGE_TAG
# BUG IC-15: GitHub Actions interpolates ${{ secrets.* }} before the
# runner executes the shell command. The expanded secret value is printed
# directly to the workflow log, which is visible to every repository
# collaborator and stored by GitHub for 90 days.
# Even with "secret masking", GitHub only masks the exact stored value —
# any transformation (base64, truncation) bypasses the mask.
# Fix: never echo secrets. Remove these debug lines entirely.
# If you need to verify a secret is set, check `secrets.DB_PASSWORD != ''`
# in an `if:` condition rather than printing it.
- name: Debug deployment config
run: |
echo "Deploying with DB password: ${{ secrets.DB_PASSWORD }}"
echo "JWT secret in use: ${{ secrets.JWT_SECRET }}"
echo "Stripe key prefix: ${{ secrets.STRIPE_API_KEY }}"
echo "Deploy triggered by: ${{ github.actor }} at $(date)"
- name: Update kubeconfig
run: |
aws eks update-kubeconfig --name axiom-production --region us-east-1
- name: Apply Kubernetes manifests
run: |
kubectl apply -f kubernetes/ --recursive
- name: Wait for rollout
run: |
kubectl rollout status deployment/api -n axiom --timeout=300s
kubectl rollout status deployment/frontend -n axiom --timeout=300s