-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.06 KB
/
Copy pathmain.yaml
File metadata and controls
41 lines (35 loc) · 1.06 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
name: AWS Lambda Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: GitHubActions
- name: get-caller-identity is allowed to run on role.
run: aws sts get-caller-identity
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
cd awslambda
pip install -r requirements.txt -t .
- name: Deploy to AWS Lambda
run: |
cd awslambda && zip -r package.zip ./*
aws lambda update-function-code \
--function-name {CHANGE_THIS_TO_LAMBDA_FUNCTION_NAME} --zip-file fileb://package.zip --publish