-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (87 loc) · 2.91 KB
/
workflow.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Master Workflow
on:
pull_request:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
jobs:
deploy-dev:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set Secrets
run: |
CONTENT=`jq '.test.environment_variables.BUCKET_NAME="${{secrets.LAMBDA_DEV_BUCKET}}"' zappa_settings.json` && echo $CONTENT > zappa_settings.json
- name: Configure AWS Creds
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install poetry
run: |
pip install poetry
- name: Install dependencies
run: poetry install --no-interaction
- name: Zappa deployments
run: |
poetry run zappa update dev
deploy-test:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set Secrets
run: |
CONTENT=`jq '.test.environment_variables.BUCKET_NAME="${{secrets.LAMBDA_TEST_BUCKET}}"' zappa_settings.json` && echo $CONTENT > zappa_settings.json
- name: Configure AWS Creds
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install poetry
run: |
pip install poetry
- name: Install dependencies
run: poetry install --no-interaction
- name: Zappa deployments
run: |
poetry run zappa update test
deploy-production:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set Secrets
run: |
CONTENT=`jq '.production.environment_variables.BUCKET_NAME="${{secrets.LAMBDA_PRODUCTION_BUCKET}}"' zappa_settings.json` && echo $CONTENT > zappa_settings.json
- name: Configure AWS Creds
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install poetry
run: |
pip install poetry
- name: Install dependencies
run: poetry install --no-interaction
- name: Zappa deployments
run: |
poetry run zappa update production