-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.61 KB
/
deploy.yaml
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
name: Deploy to AWS Lambda
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
deploy:
environment: deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
audience: sts.amazonaws.com
aws-region: ap-southeast-2
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t ${REGISTRY}/multi-gitter-runner:latest -t ${REGISTRY}/multi-gitter-runner:${IMAGE_TAG} .
docker push ${REGISTRY}/multi-gitter-runner --all-tags
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm clean-install
- run: npm install --global aws-cdk
- run: npx tsc
- name: Synthesise and Deploy AWS Stack
env:
APP_ID: ${{ secrets.APP_ID }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
IMAGE_TAG: ${{ github.sha }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
run: |
cdk synthesize --app "node dist/infrastructure"
cdk deploy --app "node dist/infrastructure" --ci true --require-approval never --force true