-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.yml
53 lines (45 loc) · 1.34 KB
/
deploy.yml
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
name: Serverless Deploy
concurrency:
group: cd-${{ github.ref }}
on:
push:
branches:
- dev
- main
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: platform-eng-ent-v2-dual
strategy:
matrix:
go-version: [1.18.x]
environment: ${{ github.ref_name }}
env:
STAGE: ${{ secrets.STAGE }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.ROLE_ARN }}
role-session-name: gh-actions
aws-region: ap-southeast-1
- name: Validate AWS Access
run: |
aws sts get-caller-identity
- name: Create deployment packages
run: |
GOPRIVATE=github.com/SPHTech CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/serverless cmd/serverless/main.go
zip -r bin/handler.zip bin
zip -ur bin/handler.zip ./configs
- name: Update Lambda code (shell lambda was setup using TF)
run: |
aws lambda update-function-code --function-name=home-feed --zip-file=fileb://bin/handler.zip