Skip to content

Commit e144d9b

Browse files
Add github actions deployment workflow
1 parent 7056ab7 commit e144d9b

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy CDK
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
deploy_branch:
10+
description: 'Branch to deploy'
11+
required: true
12+
default: 'main'
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build application
32+
run: npm run build
33+
34+
- name: Build Lambda layer
35+
run: npm run build:layer
36+
37+
- name: Configure AWS credentials
38+
uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
41+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
42+
aws-region: ${{ secrets.AWS_REGION }}
43+
44+
- name: Install CDK dependencies
45+
run: npm ci
46+
working-directory: infra
47+
48+
- name: Deploy
49+
run: npx cdk deploy --require-approval never
50+
working-directory: infra

0 commit comments

Comments
 (0)