-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.43 KB
/
deploy-lambda.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
54
55
56
57
58
name: Build + Deploy Backend
on:
workflow_dispatch:
inputs:
buildPath:
description: 'Backend Lambda'
required: true
default: 'onGameStateChange'
type: choice
options:
- onConnect
- onDisconnect
- onSend
- onHostSend
- onGameStateChange
jobs:
build-backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './backend/lambdas/${{ inputs.buildPath }}'
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# cache: 'yarn'
# cache-dependency-path: 'backend/lambdas/${{ inputs.buildPath }}/yarn.lock'
# - name: Install Backend
# run: yarn install
# - name: Test Backend
# run: yarn test
- name: Zip lambda package
run: zip -r lambda_package.zip *
- name: Configure AWS Credentials for Lambda Access
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_LAMBDA_ROLE_ARN }}
role-duration-seconds: 900
aws-region: eu-west-2
- name: Deploy lambda
run: aws lambda update-function-code --function-name 'santas-lambda-${{ inputs.buildPath }}' --zip-file fileb://lambda_package.zip