-
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (59 loc) · 1.74 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy
on:
push:
branches:
- development
- main
schedule:
- cron: "6 1 * * *" # Run once daily
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
AIRTABLE_BASE: ${{ secrets.AIRTABLE_BASE }}
AIRTABLE_KEY: ${{ secrets.AIRTABLE_KEY }}
AIRTABLE_TABLE: ${{ secrets.AIRTABLE_TABLE }}
AIRTABLE_VIEW: ${{ secrets.AIRTABLE_VIEW }}
REPORT_ERROR_PATH: ${{ secrets.REPORT_ERROR_PATH }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install AWS CLI
run: |
python -m pip install --upgrade pip
pip install awscli
- uses: actions/setup-node@v1
with:
node-version: "11.x"
- name: Cache JS dependencies
uses: actions/cache@v1
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-
- run: make install
- name: "Staging: Build and deploy"
if: github.ref == 'refs/heads/development'
env:
SITE_URL: https://covid-staging.citybureau.org
S3_BUCKET: city-bureau-covid-staging
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_STAGE }}
run: |
make build
make deploy
- name: "Production: Build and deploy"
if: github.ref == 'refs/heads/main'
env:
S3_BUCKET: city-bureau-covid-prod
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_PROD }}
run: |
make build
make deploy