-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (58 loc) · 2.03 KB
/
Copy pathdeploy-lambda-functions.yml
File metadata and controls
68 lines (58 loc) · 2.03 KB
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
59
60
61
62
63
64
65
66
67
68
name: Deploy Lambda functions
on:
push:
branches:
- main
paths:
- .github/workflows/deploy-lambda-functions.yml
- .github/workflows/build-lambda-functions.yml
- pnpm-monorepo/**
workflow_dispatch:
inputs:
environment:
description: "Target environment"
required: true
default: "test"
type: choice
options:
- test
git_ref:
description: "Git ref (SHA, tag, branch, ...) to deploy (if empty, defaults to the latest commit)"
type: string
default: "develop"
required: true
jobs:
build:
uses: ./.github/workflows/build-lambda-functions.yml
with:
git_ref: ${{ github.event.inputs.git_ref || 'develop' }}
deploy:
runs-on: ubuntu-24.04
# Related
# - https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# - https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps
permissions:
id-token: write # Required for aws-actions/configure-aws-credentials
contents: read # Required for aws-actions/configure-aws-credentials
needs: [build]
environment: lambda-functions-${{ inputs.environment || 'test' }}
strategy:
matrix:
function:
- midnight-automations
- frequent-automations
- scrape-discord-events-function
- notification-router
- email-function
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1
with:
role-to-assume: ${{ vars.IAM_ROLE_ARN }}
aws-region: eu-central-1
- name: Retrieve ${{ matrix.function }} artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.function }}-dist
- name: Deploy ${{ matrix.function }}
run: aws lambda update-function-code --function-name ${{ matrix.function }} --zip-file fileb://${{ matrix.function }}.zip