-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 1.21 KB
/
backend-deploy.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
name: DeployBackend
on:
workflow_run:
workflows: [ PythonTest ]
branches:
- master
types:
- completed
jobs:
deploy:
name: Deploy
environment:
name: github-pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/contact_form_lambda
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The triggering workflow passed'
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install Dependencies
run: 'ls -la && pip install -r requirements.txt -t ./package --platform manylinux2014_x86_64 --only-binary=:all:'
- name: Archive the lambda function code and dependencies
run: cp main.py package/main.py && zip -r deployment_package.zip package
- name: Push code to lambda
run: aws lambda update-function-code --function-name ${{ env.AWS_LAMBDA_FUNCTION_ARN }} --zip-file fileb://deployment_package.zip