Skip to content

Commit b893f5a

Browse files
Add GitHub Actions workflow for AWS deployment
1 parent 9e03524 commit b893f5a

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/deploy-aws.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Python Scraper to AWS
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
workflow_dispatch:
8+
9+
env:
10+
LAMBDA_FUNCTION_ARN: arn:aws:lambda:us-east-1:211635102441:function:TransnetLambda
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Configure AWS credentials
21+
uses: aws-actions/configure-aws-credentials@v4
22+
with:
23+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
24+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+
aws-region: ${{ secrets.AWS_REGION }}
26+
27+
- name: Zip Lambda files
28+
# Zipping 'lambda_function.py' and 'models.py'
29+
run: zip lambda-deployment.zip lambda_function.py models.py
30+
31+
- name: Deploy to AWS Lambda
32+
run: |
33+
aws lambda update-function-code \
34+
--function-name ${{ env.LAMBDA_FUNCTION_ARN }} \
35+
--zip-file fileb://lambda-deployment.zip

0 commit comments

Comments
 (0)