-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.33 KB
/
deploy-lambda.yaml
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
name: "Deploy AWS Lambda"
on:
pull_request:
types: [closed]
branches: [main]
jobs:
deploy-lambda:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10.6'
- name: Install dependencies
run: |
cd lambda_handlers
mkdir package
pip install \
--platform manylinux2014_x86_64 \
--target=package \
--implementation cp \
--python-version 3.10 \
--only-binary=:all: --upgrade \
pillow boto3
- name: Zip the package
run: |
cd lambda_handlers/package
zip -r ../lambda_function.zip .
cd ..
zip lambda_function.zip lambda_function.py
- name: Deploy to AWS Lambda
uses: appleboy/[email protected]
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_DEFAULT_REGION }}
function_name: ${{ secrets.AWS_LAMBDA_FUNCTION_NAME }}
zip_file: lambda_handlers/lambda_function.zip
runtime: python3.10