-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 1.04 KB
/
lambda.yml
File metadata and controls
40 lines (34 loc) · 1.04 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
name: Deploy Lambda Functions
on:
push:
branches:
- main
paths:
- 'lambda_functions/*.py'
jobs:
deploy-lambda:
name: Deploy Lambda Functions
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Deploy Lambda Functions
run: |
for file in lambda_functions/*.py; do
if [ "$(basename $file)" != "__init__.py" ]; then
function_name=$(basename $file .py)
echo "Deploying $function_name..."
zip -j "$function_name.zip" "$file"
aws lambda update-function-code --function-name $function_name --zip-file fileb://"$function_name.zip"
fi
done