-
Notifications
You must be signed in to change notification settings - Fork 8
249 lines (228 loc) · 8.32 KB
/
ci_cd.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: ci_cd
on: push
env:
TURBO_CACHE_DIR: .turbo
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Lint
run: npm run lint --if-present
- name: Build
run: npm run build --if-present
- name: Test
run: npm run test --if-present
- id: modified_paths_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_filter: |
availability:
paths:
- 'apps/availability/**'
backend:
paths:
- 'apps/backend/**'
bubble-proxy:
paths:
- 'apps/bubble-proxy/**'
frontend-example:
paths:
- 'apps/frontend-example/**'
infra:
paths:
- 'apps/infra/**'
login:
paths:
- 'apps/login/**'
meet:
paths:
- 'apps/meet/**'
miniextensions-proxy:
paths:
- 'apps/miniextensions-proxy/**'
paths: '["package-lock.json"]'
paths_ignore: '["**/README.md"]'
outputs:
should_skip: ${{ steps.modified_paths_check.outputs.should_skip }}
paths_result: ${{ steps.modified_paths_check.outputs.paths_result }}
cd_infra:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).infra.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_infra
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
echo "$INFRA_PULUMI_PASSPHRASE" > apps/infra/passphrase.prod.txt
mkdir -p ~/.aws
echo "$INFRA_AWS_CREDENTIALS" > ~/.aws/credentials
env:
INFRA_PULUMI_PASSPHRASE: ${{ secrets.INFRA_PULUMI_PASSPHRASE }}
# See the infra README - these should actually have details for Vultr Object Storage
INFRA_AWS_CREDENTIALS: ${{ secrets.INFRA_AWS_CREDENTIALS }}
- name: Deploy
run: npm run deploy:prod --workspace apps/infra
cd_frontend-example:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).frontend-example.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_frontend-example
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/frontend-example
cd_availability:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).availability.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_availability
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/availability
cd_login:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).login.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_login
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/login
cd_meet:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).meet.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_meet
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/meet
cd_miniextensions-proxy:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && (needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).miniextensions-proxy.should_skip) }}
runs-on: ubuntu-latest
concurrency:
group: cd_miniextensions-proxy
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/miniextensions-proxy