-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.31 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy to AWS Lambda
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: Preview
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install AWS CLI
run: |
sudo apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region ${{ vars.AWS_REGION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Package application
run: |
zip -r deployment_package.zip .
# - name: Deploy to AWS Lambda - Production
# if: env.ENVIRONMENT == 'Production'
# run: |
# aws lambda update-function-code --function-name prod-lta-datasets-updater --zip-file fileb://deployment_package.zip
- name: Deploy to AWS Lambda - Preview
run: |
aws lambda update-function-code --function-name dev-lta-datasets-updater --zip-file fileb://deployment_package.zip