-
Notifications
You must be signed in to change notification settings - Fork 6
143 lines (127 loc) · 5.01 KB
/
ci.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: CI
on: [push, pull_request]
env:
CI: true
API_DEPLOY_PATH: packages/api/dist
API_INTEG_APP_NAME: ops-suite-api-integration
API_PROD_APP_NAME: ops-suite-api-prod
API_DEMO_APP_NAME: ops-suite-api-demo
WEBAPP_INTEG_STORAGE_ACCOUNT: 'opssuitewebappinteg'
WEBAPP_PROD_STORAGE_ACCOUNT: 'opssuitewebappprod'
WEBAPP_DEMO_STORAGE_ACCOUNT: 'opssuitewebappdemo'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
services:
mongodb:
image: mongo
ports:
- 27017:27017
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn build:schema
- run: 'yarn lint:'
- run: 'yarn assets:'
- run: 'yarn test:'
- run: 'yarn build:'
- run: yarn install:playwright_deps
- run: yarn acceptance:test
- run: yarn git_is_clean
deploy-integ:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'
needs: ['build']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn install
- run: yarn prepare_for_deployment
env:
DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING_INTEG }}
- name: 'Deploy Integ API'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.API_INTEG_APP_NAME }}
package: ${{ env.API_DEPLOY_PATH }}
publish-profile: ${{ secrets.API_INTEG_PUBLISH_PROFILE }}
- name: Deploy Integ Webapp
run: yarn build:webapp:integ && yarn deploy:webapp
env:
WEBAPP_STORAGE_ACCOUNT: ${{ env.WEBAPP_INTEG_STORAGE_ACCOUNT }}
WEBAPP_STORAGE_KEY: ${{ secrets.WEBAPP_INTEG_STORAGE_KEY }}
APPLICATION_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.WEBAPP_INTEG_APPINSIGHTS_KEY }}
FIREBASE_API_KEY: ${{ secrets.WEBAPP_FIREBASE_API_KEY }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.WEBAPP_FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.WEBAPP_FIREBASE_APP_ID }}
FIREBASE_MEASUREMENT_ID: ${{ secrets.WEBAPP_FIREBASE_MEASUREMENT_ID }}
FIREBASE_VAPID_SERVER_KEY: ${{ secrets.WEBAPP_FIREBASE_VAPID_SERVER_KEY }}
deploy-demo:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: ['build']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn install
- run: yarn prepare_for_deployment
env:
DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING_DEMO }}
- name: 'Deploy Demo API'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.API_DEMO_APP_NAME }}
package: ${{ env.API_DEPLOY_PATH }}
publish-profile: ${{ secrets.API_DEMO_PUBLISH_PROFILE }}
- name: Deploy Demo Webapp
run: yarn build:webapp:demo && yarn deploy:webapp
env:
WEBAPP_STORAGE_ACCOUNT: ${{ env.WEBAPP_DEMO_STORAGE_ACCOUNT }}
WEBAPP_STORAGE_KEY: ${{ secrets.WEBAPP_DEMO_STORAGE_KEY }}
APPLICATION_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.WEBAPP_DEMO_APPINSIGHTS_KEY }}
FIREBASE_API_KEY: ${{ secrets.WEBAPP_FIREBASE_API_KEY }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.WEBAPP_FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.WEBAPP_FIREBASE_APP_ID }}
FIREBASE_MEASUREMENT_ID: ${{ secrets.WEBAPP_FIREBASE_MEASUREMENT_ID }}
FIREBASE_VAPID_SERVER_KEY: ${{ secrets.WEBAPP_FIREBASE_VAPID_SERVER_KEY }}
deploy-production:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: ['build']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn install
- run: yarn prepare_for_deployment
env:
DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING_PROD }}
- name: 'Deploy Production API'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.API_PROD_APP_NAME }}
package: ${{ env.API_DEPLOY_PATH }}
publish-profile: ${{ secrets.API_PROD_PUBLISH_PROFILE }}
- name: Deploy Production Webapp
run: yarn build:webapp:prod && yarn deploy:webapp
env:
WEBAPP_STORAGE_ACCOUNT: ${{ env.WEBAPP_PROD_STORAGE_ACCOUNT }}
WEBAPP_STORAGE_KEY: ${{ secrets.WEBAPP_PROD_STORAGE_KEY }}
APPLICATION_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.WEBAPP_PROD_APPINSIGHTS_KEY }}
FIREBASE_API_KEY: ${{ secrets.WEBAPP_FIREBASE_API_KEY }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.WEBAPP_FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.WEBAPP_FIREBASE_APP_ID }}
FIREBASE_MEASUREMENT_ID: ${{ secrets.WEBAPP_FIREBASE_MEASUREMENT_ID }}
FIREBASE_VAPID_SERVER_KEY: ${{ secrets.WEBAPP_FIREBASE_VAPID_SERVER_KEY }}