-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (84 loc) · 2.82 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
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
name: Deploy
on:
push:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 20
- name: npm install dependencies
run: npm install
- name: run prettier
run: npm run prettier
- name: run tslint
run: npm run lint
- name: run tests
run: npm run test
env:
SS_AUTH_ID: ${{ secrets.SS_AUTH_ID }}
SS_AUTH_TOKEN: ${{ secrets.SS_AUTH_TOKEN }}
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USERNAME: postgres
build:
runs-on: ubuntu-latest
needs: test
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 20
- name: npm install dependencies
run: npm install
- name: create ormconfig.json
run: echo $ORMCONFIG_JSON > $GITHUB_WORKSPACE/ormconfig.json
env:
ORMCONFIG_JSON: ${{ secrets.ORMCONFIG_JSON }}
- name: deploy to aws
uses: serverless/github-action@v1.53.0
with:
args: deploy --stage prod
env:
SS_AUTH_ID: ${{ secrets.SS_AUTH_ID }}
SS_AUTH_TOKEN: ${{ secrets.SS_AUTH_TOKEN }}
ZAP_NEW_REPORT: ${{ secrets.ZAP_NEW_REPORT }}
ZAP_NEW_LOCATION: ${{ secrets.ZAP_NEW_LOCATION }}
ZAP_NEW_ORDER: ${{ secrets.ZAP_NEW_ORDER }}
ZAP_NEW_UPLOAD: ${{ secrets.ZAP_NEW_UPLOAD }}
ZAP_NEW_TRUCK: ${{ secrets.ZAP_NEW_TRUCK }}
ZAP_SKIP_REPORT: ${{ secrets.ZAP_SKIP_REPORT }}
ZAP_TRUCK_REPORT: ${{ secrets.ZAP_TRUCK_REPORT }}
ZAP_ORDER_REPORT: ${{ secrets.ZAP_ORDER_REPORT }}
ZAP_CANCEL_ORDER_REPORT: ${{ secrets.ZAP_CANCEL_ORDER_REPORT }}
GOOGLE_MAPS_KEY: ${{ secrets.GOOGLE_MAPS_KEY }}
STATIC_SITE: 'https://polls.pizza'
BUGSNAG_KEY: ${{ secrets.BUGSNAG_KEY }}
ALLOWED_ORIGINS: polls.pizza
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_KEY }}
STRIPE_PRODUCT_ID: ${{ secrets.STRIPE_PRODUCT_ID }}
STRIPE_SECRET_WH: ${{ secrets.STRIPE_WH }}
MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
- name: sync schema
run: npm run schema:sync