-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.2 KB
/
aws-python-lambda-deploy.yml
File metadata and controls
52 lines (44 loc) · 1.2 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
name: Deploy Python Lambda
on:
workflow_call:
inputs:
python_version:
required: true
type: string
aws_function_name:
required: true
type: string
aws_region:
required: false
type: string
default: 'eu-north-1'
permissions:
id-token: write
contents: read
jobs:
deploy:
name: Deploy Lambda
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Install dependencies
run: |
pip install -r requirements.txt -t .
- name: Package Lambda function
run: zip -r lambda.zip .
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ inputs.aws_region }}
- name: Deploy to AWS Lambda
uses: appleboy/lambda-action@v0.2.0
with:
aws_region: ${{ inputs.aws_region }}
function_name: ${{ inputs.aws_function_name }}
zip_file: lambda.zip