-
Notifications
You must be signed in to change notification settings - Fork 10
106 lines (88 loc) · 2.88 KB
/
deploy-prod.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Deploy prod
on:
push:
branches:
- main
env:
ENV: "prod"
PROJECT: "openaq"
DATABASE_READ_USER: ${{ secrets.DATABASE_READ_USER }}
DATABASE_READ_PASSWORD: ${{ secrets.DATABASE_READ_PASSWORD }}
DATABASE_WRITE_USER: ${{ secrets.DATABASE_WRITE_USER }}
DATABASE_WRITE_PASSWORD: ${{ secrets.DATABASE_WRITE_PASSWORD }}
DATABASE_DB: ${{ secrets.DATABASE_DB }}
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_PORT: ${{ secrets.DATABASE_PORT }}
FETCH_ASCENDING: ${{ secrets.FETCH_ASCENDING }}
PIPELINE_LIMIT: ${{ secrets.PIPELINE_LIMIT }}
METADATA_LIMIT: ${{ secrets.METADATA_LIMIT }}
REALTIME_LIMIT: ${{ secrets.REALTIME_LIMIT }}
FETCH_BUCKET: ${{ secrets.FETCH_BUCKET }}
ETL_BUCKET: ${{ secrets.ETL_BUCKET }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
HOSTED_ZONE_NAME: ${{ secrets.HOSTED_ZONE_NAME }}
DOMAIN_NAME: "api.openaq.org"
WEB_ACL_ID: ${{ secrets.WEB_ACL_ID }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
FASTAPI_URL: ""
CDK_ACCOUNT: ${{ secrets.CDK_ACCOUNT }}
CDK_REGION: ${{ secrets.CDK_REGION }}
VPC_ID: ${{ secrets.VPC_ID }}
RATE_LIMITING: True
RATE_AMOUNT: 100
RATE_AMOUNT_KEY: 400
RATE_TIME: 1
USER_AGENT: ${{ secrets.USER_AGENT }}
ORIGIN: ${{ secrets.ORIGIN }}
EMAIL_SENDER: ${{ secrets.EMAIL_SENDER }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_PROD }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: build pages
working-directory: ./pages
run: |
yarn install
yarn run deploy
- name: Install CDK
run: |
npm install -g [email protected]
- uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Deploy stack
working-directory: ./cdk
run: |
pip install -r requirements.txt
cdk deploy openaq-api-prod --require-approval never
update-docs:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: build schema
working-directory: ./openaq_api
run: |
pip install -r requirements.txt
npm install -g rdme@latest
python generate_schema.py
VERSION=
rdme openapi openapi.json --version=$VERSION --key=${{ secrets.README_KEY }} --id=${{ secrets.README_API_DEFINITION_ID }}