-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.43 KB
/
backend.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
name: Deploy the AWS Lambdas
on:
pull_request:
branches:
- 'live'
paths:
- 'backend/**'
jobs:
deploy-backend:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Build subscribe function
working-directory: backend
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build subscribe.go
zip -j ./subscribe.zip ./subscribe
- name: Build broadcast function
working-directory: backend
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build broadcast.go
zip -j ./broadcast.zip ./broadcast
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy subscribe function
working-directory: backend
run: |
aws lambda update-function-code --function-name ${{ vars.LAMBDA_FUNCTION_SUBSCRIBE }} --zip-file fileb://./subscribe.zip
- name: Deploy broadcast function
working-directory: backend
run: |
aws lambda update-function-code --function-name ${{ vars.LAMBDA_FUNCTION_BROADCAST }} --zip-file fileb://./broadcast.zip