-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.31 KB
/
lambda_zipper.yml
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
name: Zip Lambda Jobs and Upload to S3
on:
push:
branches:
- main
paths:
- 'herding_cats_pipelines/lambda_jobs/**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Ruff
run: pip install ruff
- name: Run Ruff
run: ruff check ./herding_cats_pipelines/lambda_jobs
zip-and-upload:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies and zip Lambda function
run: |
cd ./herding_cats_pipelines/lambda_jobs
pip install -r requirements.txt -t ./package
cp *.py ./package/
cd ./package && zip -r ../lambda_herding_cats_jobs.zip .
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "eu-west-2"
- name: Upload to S3
run: |
cd ./herding_cats_pipelines/lambda_jobs
aws s3 cp lambda_herding_cats_jobs.zip s3://${{ secrets.S3_BUCKET_NAME }}/lambda_herding_cats_jobs.zip