@@ -9,77 +9,10 @@ concurrency:
99
1010jobs :
1111 deploy :
12- name : Deploy
13- runs-on : ubuntu-latest
14- timeout-minutes : 15
15-
16- permissions :
17- contents : read
18- id-token : write
19-
20- steps :
21- - name : Checkout repository
22- uses : actions/checkout@v6
23-
24- - name : Setup Node.js
25- uses : actions/setup-node@v6
26- with :
27- node-version-file : .nvmrc
28- cache : ' npm'
29-
30- - name : Configure AWS credentials
31- uses : aws-actions/configure-aws-credentials@v6
32- with :
33- role-to-assume : ${{ vars.AWS_ROLE_ARN_DEV }}
34- aws-region : ${{ vars.AWS_REGION }}
35- role-session-name : deploy-dev-lambda-starter
36-
37- - name : Install dependencies
38- run : npm ci
39-
40- - name : Build application
41- run : npm run build
42-
43- - name : Run tests
44- run : npm run test
45-
46- - name : Install infrastructure dependencies
47- working-directory : ./infrastructure
48- run : npm ci
49-
50- - name : Create infrastructure .env file
51- working-directory : ./infrastructure
52- run : echo "${{ vars.CDK_ENV_DEV }}" > .env
53-
54- - name : Build infrastructure
55- working-directory : ./infrastructure
56- run : npm run build
57-
58- - name : Bootstrap CDK (if needed)
59- working-directory : ./infrastructure
60- run : |
61- # Check if bootstrap is needed
62- if ! aws cloudformation describe-stacks --stack-name CDKToolkit --region ${{ vars.AWS_REGION }} >/dev/null 2>&1; then
63- echo "Bootstrapping CDK..."
64- npm run bootstrap
65- else
66- echo "CDK already bootstrapped"
67- fi
68-
69- - name : Synthesize CDK stacks
70- working-directory : ./infrastructure
71- run : npm run synth
72-
73- - name : Deploy CDK stacks
74- working-directory : ./infrastructure
75- run : npm run deploy:all -- --require-approval never --progress events
76-
77- # Final Step: Clean up sensitive infrastructure files
78- - name : Clean up sensitive files
79- if : always()
80- working-directory : ./infrastructure
81- run : |
82- echo "🧹 Cleaning up sensitive files..."
83- rm -f .env
84- rm -rf cdk.out
85- echo "✅ Sensitive files cleaned up"
12+ name : Deploy to DEV
13+ uses : ./.github/workflows/deploy-reusable.yml
14+ with :
15+ aws_role_arn : ${{ vars.AWS_ROLE_ARN_DEV }}
16+ aws_region : ${{ vars.AWS_REGION }}
17+ cdk_env : ${{ vars.CDK_ENV_DEV }}
18+ secrets : inherit
0 commit comments