-
Notifications
You must be signed in to change notification settings - Fork 19
465 lines (458 loc) · 27.2 KB
/
deployment.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
name: Dispatch Deploy
on:
workflow_dispatch:
inputs:
network:
description: "Network"
required: true
type: choice
options:
- "Baobab"
- "Cypress"
application:
description: "Service"
required: true
type: choice
options:
- "cli"
- "vrf"
- "api"
- "request-response"
- "delegator"
- "por"
- "node"
- "boot-api"
- "sentinel"
- "dal"
- "reporter"
- "logscribe"
image:
description: "Image Version"
required: true
type: choice
default: "new"
options:
- new
- reporter:v0.0.1.20240801.0750.b725976:Sentinel Update threshold to r...
- sentinel:v0.0.1.20240801.0753.169c3c9:Sentinel Update threshold to r...
- sentinel:v0.0.1.20240801.0907.c3a64db:Sentinel Change threshold to r...
- sentinel:v0.0.1.20240802.0153.63a109c:OraklNode Mutex lock instead o...
- dal:v0.0.1.20240802.0156.df96ad7:OraklNode Mutex lock instead o...
- node:v0.0.1.20240802.0200.b20a5c6:OraklNode Mutex lock instead o...
- dal:v0.0.1.20240802.0301.e8ff73c:DAL dal logs for debugging
- dal:v0.0.1.20240802.0426.303cd85:DAL Prevent possible race cond...
- dal:v0.0.1.20240802.0554.e60151d:DAL Fix ws deadlock
- sentinel:v0.0.1.20240802.0656.c31b1af:Sentinel Alarm count offset fo...
- sentinel:v0.0.1.20240802.0722.815e34a:Sentinel Initialize count if i...
- dal:v0.0.1.20240802.0737.d1641c9:DAL Prevent deadlock from mult...
- dal:v0.0.1.20240802.0814.2366d70:DAL definite unlock through de...
- dal:v0.0.1.20240802.0902.33bad15:DAL definite unlock through de...
- node:v0.0.1.20240805.0142.77d6df9:DAL Chore minor dal optimizati...
- dal:v0.0.1.20240805.0149.18cb534:DAL Chore minor dal optimizati...
- node:v0.0.1.20240805.0419.cadaade:OraklNode Offchain Proof and T...
- dal:v0.0.1.20240805.0421.cadaade:OraklNode Offchain Proof and T...
- logscribe:v0.0.1.20240805.0548.4a1cddf:Contract Deploy cypress submis...
- logscribe:v0.0.1.20240805.0558.ee14074:Contract Deploy cypress submis...
- logscribe:v0.0.1.20240805.0615.4fde42a:Contract Deploy cypress submis...
- logscribe:v0.0.1.20240805.0639.4d0df4b:Contract Deploy cypress submis...
- node:v0.0.1.20240805.0858.7647cf1:OraklNode Minor updates add em...
- dal:v0.0.1.20240805.0904.8bc24f7:OraklNode Minor updates add em...
- dal:v0.0.1.20240805.1011.e61e2a9:DAL update log
- node:v0.0.1.20240807.0149.4005140:OraklNode Msg replay preventio...
- node:v0.0.1.20240807.0233.c512afe:OraklNode Mutex lock roundID
- node:v0.0.1.20240807.0400.5926df7:OraklNode Rollback raft msg re...
- node:v0.0.1.20240807.0514.6907ece:OraklNode Admin add fallback t...
- dal:v0.0.1.20240807.0602.570af13:DAL Set log lv from env
- node:v0.0.1.20240807.0628.0de723f:OraklNode Add step to fix glob...
- node:v0.0.1.20240807.0831.bef131a:OraklNode Possible fix for mem...
- node:v0.0.1.20240807.0845.28f066d:OraklNode Dont increase raft t...
- node:v0.0.1.20240807.1057.37fd445:OraklNode fix memory leak lin...
- node:v0.0.1.20240808.0118.9477188:OraklNode Improve message hand...
- node:v0.0.1.20240808.0506.cea77a4:OraklNode Reduce default 120 s...
- node:v0.0.1.20240808.0519.79fb175:OraklNode hotfix segmentation ...
- logscribe:v0.0.1.20240808.0640.42454de:OraklNode hotfix segmentation ...
- node:v0.0.1.20240808.0642.ce80216:OraklNode hotfix segmentation ...
- node:v0.0.1.20240808.0659.628fe3d:provide default endpoint for l...
- node:v0.0.1.20240809.0442.cf7529f:separate console and logscribe...
- sentinel:v0.0.1.20240809.0726.87b4291:zerolog remove table up and do...
- sentinel:v0.0.1.20240809.0738.edc2361:Sentinel update dal timestamp ...
- delegator:v0.0.1.20240809.0742.a9a293a:Sentinel update dal timestamp ...
- api:v0.0.1.20240809.0752.7dc3d11:Sentinel update dal timestamp ...
- node:v0.0.1.20240812.0227.c2b15cb:OraklNode Fix lbank error
- node:v0.0.1.20240812.0439.b625a71:OraklNode Chore send local agg...
- dal:v0.0.1.20240812.0444.afcb8fe:OraklNode Chore send local agg...
- node:v0.0.1.20240814.0251.6443972:OraklNode Replace feed data bu...
- sentinel:v0.0.1.20240814.0346.da204fd:OraklNode Replace feed data bu...
- logscribe:v0.0.1.20240814.0542.88ab971:go mod tidy
- logscribe:v0.0.1.20240814.0610.0520a11:get github credentials using s...
- dal:v0.0.1.20240814.0612.0d5b858:get github credentials using s...
- sentinel:v0.0.1.20240814.0658.fddaeab:Sentinel add missing for loop
- dal:v0.0.1.20240814.0947.2706f2a:DAL Update logic to prevent du...
- node:v0.0.1.20240814.0951.5efd845:DAL Update logic to prevent du...
- sentinel:v0.0.1.20240814.1305.7c641fe:Sentinel Add missing status co...
- sentinel:v0.0.1.20240816.0429.b14407c:health check for logscribe
- logscribe:v0.0.1.20240816.0436.b420ff4:health check for logscribe
- api:v0.0.1.20240816.0524.ed93e4c:API Add missing version file
- delegator:v0.0.1.20240816.0529.a570456:API Add missing version file
- sentinel:v0.0.1.20240816.0531.a570456:API Add missing version file
- por:v0.0.1.20240816.0537.1b730d9:API Add missing version file
- boot-api:v0.0.1.20240816.0551.4e79ea6:API Add missing version file
- dal:v0.0.1.20240816.0556.f41bf29:API Add missing version file
- reporter:v0.0.1.20240816.0600.682fdf5:API Add missing version file
- node:v0.0.1.20240816.0628.8614a4b:API Add missing version file
- sentinel:v0.0.1.20240816.0639.71fe82c:API Add missing version file
- node:v0.0.1.20240816.0727.3a913ee:HOTFIX Hotfix sync error
- node:v0.0.1.20240819.0130.f2bd8e4:OraklNode Update raft implemen...
- dal:v0.0.1.20240819.0334.4efcb62:OraklNode Update raft implemen...
- logscribe:v0.0.1.20240819.0645.890e46a:Logscribe Increase bulk copy i...
- sentinel:v0.0.1.20240819.0701.340f3cb:Logscribe Increase bulk copy i...
- sentinel:v0.0.1.20240819.0806.a1a0c72:Sentinel Disable offset checke...
- request-response:v0.5.1.20240819.1054.d8c7769:make rr use nonce manager and ...
- request-response:v0.5.1.20240819.1120.e3bc4a9:add rr logs
- sentinel:v0.0.1.20240819.1326.d2988e4:Sentinel Disable drainage chec...
- node:v0.0.1.20240820.0233.893d589:OraklNode Update cryptocom end...
- node:v0.0.1.20240820.0501.06be7a6:OraklNode fix wrong quantity f...
- logscribe:v0.0.1.20240820.0623.3140765:decrease copy logs interval an...
- reporter:v0.0.1.20240820.0624.3140765:decrease copy logs interval an...
- logscribe:v0.0.1.20240820.0715.5aab78e:add more logs to reporter and ...
- reporter:v0.0.1.20240820.0715.5aab78e:add more logs to reporter and ...
- reporter:v0.0.1.20240820.0827.9fc9b65:provide default error logscrib...
- reporter:v0.0.1.20240820.0933.6582edb:cleanup reporter and logscribe...
- api:v0.0.1.20240821.0452.cad85cb:Delegator delegator zerologs
- delegator:v0.0.1.20240821.0459.9eaee01:Delegator delegator zerologs
- por:v0.0.1.20240821.0508.827c422:Delegator delegator zerologs
- boot-api:v0.0.1.20240821.0518.50268c9:Delegator delegator zerologs
- sentinel:v0.0.1.20240821.0521.1dbabef:Delegator delegator zerologs
- dal:v0.0.1.20240821.0526.fb2baaf:Delegator delegator zerologs
- sentinel:v0.0.1.20240821.0550.a113494:Sentinel Disable DAL checks
- request-response:v0.5.1.20240821.0812.e0652e6:Revert feat implement db query...
- request-response:v0.5.1.20240821.0841.95983b2:Revert feat implement db query...
- node:v0.0.1.20240822.0448.747251b:OraklNode Update timer relativ...
- node:v0.0.1.20240822.0553.a28e062:OraklNode Increase db timeout ...
- node:v0.0.1.20240822.0603.231c655:fix rollback db timeout
- sentinel:v0.0.1.20240822.0712.cea2662:fix rollback db timeout
- sentinel:v0.0.1.20240822.0748.0d4e613:remove old tags for helm chart...
- api:v0.0.1.20240822.0934.5206f51:remove old tags for helm chart...
- delegator:v0.0.1.20240822.0936.8e96e14:remove old tags for helm chart...
- sentinel:v0.0.1.20240823.0710.ff71895:DAL Remove conditional reconne...
- sentinel:v0.0.1.20240823.0720.f81d2c5:Hotfix fix cronjob definition
- node:v0.0.1.20240823.0801.a5b5218:Hotfix fix cronjob definition
- node:v0.0.1.20240823.0815.68e21ba:OraklNode run ICMP checker aft...
- node:v0.0.1.20240823.0828.fd6f658:OraklNode Pinger add logs incr...
- node:v0.0.1.20240823.0920.ef2d951:OraklNode attempt to enable IC...
- node:v0.0.1.20240823.0938.8b9bb7a:OraklNode attempt to enable IC...
- node:v0.0.1.20240823.1006.dc56667:Revert feat implement proxy fo...
- node:v0.0.1.20240823.1023.6234edc:OraklNode Fix pinger
- dal:v0.0.1.20240823.1037.23055da:OraklNode Fix pinger
- node:v0.0.1.20240826.0432.9d138dc:OraklNode Add env for local ru...
- dal:v0.0.1.20240826.0436.ec9742f:OraklNode Add env for local ru...
- node:v0.0.1.20240826.0511.f51c98f:OraklNode Update aggregator st...
- sentinel:v0.0.1.20240826.0718.4d5081b:Sentinel Add missing cron job ...
- reporter:v0.0.1.20240826.0828.fc77e8b:handle context deadline exceed...
- node:v0.0.1.20240827.0156.9c7ee3b:OraklNode Remove aggregator wa...
- cli:v1.0.0.20240827.0226.84ed44d:OraklNode Remove aggregator wa...
- api:v0.0.1.20240827.0230.5fc28f3:OraklNode Remove aggregator wa...
- sentinel:v0.0.1.20240827.0235.e07e04a:OraklNode Remove aggregator wa...
- node:v0.0.1.20240827.0258.ef342b5:OraklNode Remove aggregator wa...
- reporter:v0.0.1.20240827.0358.a9d6c98:OraklNode Remove aggregator wa...
- por:v0.0.1.20240827.0407.8741a13:OraklNode Remove aggregator wa...
- sentinel:v0.0.1.20240827.0556.defe2b1:fetch all GitHub issues
- logscribe:v0.0.1.20240827.0559.35de62d:fetch all GitHub issues
- logscribe:v0.0.1.20240827.0757.3486519:OraklNode consume channel to f...
- node:v0.0.1.20240827.0800.49b09bd:OraklNode consume channel to f...
- reporter:v0.0.1.20240828.0244.055b603:handle context deadline exceed...
- por:v0.0.1.20240828.0244.055b603:handle context deadline exceed...
- por:v0.0.1.20240828.0540.ce5ebf0:encapsulate SubmitDelegatedFal...
- reporter:v0.0.1.20240828.0541.ce5ebf0:encapsulate SubmitDelegatedFal...
- reporter:v0.0.1.20240828.0644.6618afb:add logs to submit tx func
- sentinel:v0.0.1.20240828.0654.f4d1d08:Sentinel Add missing check inc...
- dal:v0.0.1.20240828.0820.12378ae:fetch latest data rest with ti...
- dal:v0.0.1.20240828.0900.a7dc3ae:Revert DAL Pooling broadcast 2...
- reporter:v0.0.1.20240829.0827.b5eff49:rollback tx submission encapsu...
- logscribe:v0.0.1.20240830.0536.d7fcdf0:rollback tx submission encapsu...
- sentinel:v0.0.1.20240903.0618.463ce9d:OraklNode Fix possible cause f...
- node:v0.0.1.20240903.0621.d4ef741:OraklNode Fix possible cause f...
- node:v0.0.1.20240906.0137.a2f4a5e:OraklNode Fix possible cause f...
- por:v0.0.1.20240906.0210.44681b4:POR Remove manual nonce manage...
- logscribe:v0.0.1.20240906.0439.7b8f678:CICD Fix pipeline slack channe...
- node:v0.0.1.20240926.0516.ba891a0:Node Remove max delay logic in...
- node:v0.0.1.20240928.0535.1bc27b2:DAL Remove config id reference
- dal:v0.0.1.20240928.0541.a9006e1:DAL Remove config id reference
- node:v0.0.1.20240928.1555.bd6313d:Node Add more logs
- node:v0.0.1.20240929.0552.8a9b540:Node Timeout for aggregator ms...
- node:v0.0.1.20240929.0628.993e18e:Node Increase timeout
- node:v0.0.1.20241003.0445.ff77019:Node Reduce ping error logging...
- reporter:v0.0.1.20241003.0448.13cc9ed:Node Reduce ping error logging...
- node:v0.0.1.20241003.1010.bd40cbc:Node update logs update logic ...
- node:v0.0.1.20241011.0500.374eee0:Node Support orangex
- node:v0.0.1.20241102.0401.61aea60:ws proxy support
- node:v0.0.1.20241102.0547.147f90b:ws proxy support
- node:v0.0.1.20241105.0317.a4aece2:Node Check conflict not only w...
- node:v0.0.1.20241105.0445.a515407:Node Update contraint for feed...
- sentinel:v0.0.1.20241122.0446.86dbb99:Sentinel Remove ws delay check...
- sentinel:v0.0.1.20241127.0150.cf6be1b:Sentinel DAL rest network dela...
- node:v0.0.1.20241128.0230.5c56212:Chore Add log
- reporter:v0.0.1.20241208.0239.da98ae7:ChainHelper reduce complexity ...
- reporter:v0.0.1.20241209.0109.372d616:Reporter Refresh nonce on cont...
- reporter:v0.0.1.20241209.0531.563bd73:Reporter log on reporter error
- reporter:v0.0.1.20241209.0816.d4bbdc0:Reporter Fix refresh nonce not...
- dal:v0.0.1.20241210.0815.4e13ee6:DAL Hotfix addr comparison
- dal:v0.0.1.20241210.0828.235e2b5:more logs
- dal:v0.0.1.20241210.0835.a3be57c:more logs
- node:v0.0.1.20241212.0915.28f78c5:Migrate to coinex v2
- node:v0.0.1.20241223.0235.08b79cd:Node Reduce logs
- node:v0.0.1.20241223.0247.5b3e7c5:Node Fix orangex formatting
- node:v0.0.1.20241226.0128.1b919e8:Remove upbit ticker dd propert...
- sentinel:v0.0.1.20250116.0401.c12b978:Health Reduce alert spamming
- sentinel:v0.0.1.20250116.0439.a0748c9:Health add missing skips
jobs:
prepare-taskflow:
name: Prepare
runs-on: ubuntu-latest
if: ${{ github.event.inputs.image != 'new' }}
outputs:
service: ${{ steps.tag.outputs.service }}
version: ${{ steps.package.outputs.version }}
tag_date: ${{ steps.taskflow-tag.outputs.tag_date }}
tag_git_hash: ${{ steps.taskflow-tag.outputs.tag_git_hash}}
img_tag: ${{ steps.taskflow-tag.outputs.img_tag }}
steps:
- uses: actions/checkout@master
- name: extract tags
id: taskflow-tag
run: "IMAGE_TAG=\"${{ github.event.inputs.image }}\"\nVERSION=$(echo \"${IMAGE_TAG}\" | cut -d':' -f2 | cut -d'.' -f1-3)\necho $VERSION\nTAG_DATE=$(echo \"${IMAGE_TAG}\" | cut -d':' -f2 | cut -d'.' -f4-5)\necho $TAG_DATE\nTAG_GIT_HASH=$(echo \"${IMAGE_TAG}\" | cut -d':' -f2 | cut -d'.' -f6)\nTAG=\"${VERSION}.${TAG_DATE}.${TAG_GIT_HASH}\"\necho $TAG; \necho $TAG_GIT_HASH\necho \"version=${VERSION}\" >> $GITHUB_OUTPUT\necho \"tag_date=${TAG_DATE}\" >> $GITHUB_OUTPUT\necho \"tag_git_hash=${TAG_GIT_HASH}\" >> $GITHUB_OUTPUT\necho \"img_tag=${TAG}\" >> $GITHUB_OUTPUT\n"
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
taskflow-image-update:
name: Update Image Tag
needs: [prepare-taskflow]
uses: ./.github/workflows/update.image-tag.yaml
with:
network: "baobab"
build: false
project-name: ${{ github.event.inputs.application }}
version: ${{ needs.prepare-taskflow.outputs.version }}
image-tag: ${{ needs.prepare-taskflow.outputs.img_tag}}
tag_date: ${{ needs.prepare-taskflow.outputs.tag_date }}
tag_git_hash: ${{ needs.prepare-taskflow.outputs.tag_git_hash }}
secrets:
PAT: ${{ secrets.PAT }}
if: ${{ github.event.inputs.image != 'new' }}
post-slack-taskflow-image-upload:
name: Slack message for image upload
needs: [prepare-taskflow, taskflow-image-update]
uses: ./.github/workflows/post.slack.yaml
with:
status: "Success"
slack-message: "${{ github.event.inputs.network }} ${{ github.event.inputs.application }}* : *${{ needs.prepare-taskflow.outputs.img_tag}}* is updated"
channel: "miko-notification"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ github.event.inputs.network == 'Baobab' && success() }}
prepare:
name: Prepare
runs-on: ubuntu-latest
if: ${{ github.event.inputs.network == 'Baobab' && github.event.inputs.image == 'new' }}
outputs:
tag_date: ${{ steps.tag.outputs.date }}
tag_git_hash: ${{ steps.tag.outputs.git_hash }}
service: ${{ steps.tag.outputs.service }}
ecr_url: ${{ steps.tag.outputs.ecr_url }}
version: ${{ steps.package.outputs.version }}
steps:
- uses: actions/checkout@master
- name: get time tag
id: tag
run: "# Get the date and git hash\necho \"date=$(date +'%Y%m%d.%H%M')\" >> $GITHUB_OUTPUT\necho \"git_hash=$(git rev-parse --short HEAD)\" >> $GITHUB_OUTPUT\nservice=\"${{ github.event.inputs.application }}\"\n# Set the service name\nif [[ \"$service\" == \"vrf\" || \"$service\" == \"request-response\" ]]; then\n service=\"core\"\nfi \n# Set the ecr url\necho \"service=$service\" >> $GITHUB_OUTPUT\necho \"ecr_url=public.ecr.aws/bisonai/orakl-${service}\" >> $GITHUB_OUTPUT\n# end of the script\n"
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
- name: get package version
id: package
run: "# Get the version from the package.json file\nif [[ \"${{ steps.tag.outputs.service }}\" == \"cli\" || \"${{ steps.tag.outputs.service }}\" == \"core\" ]]; then \necho \"version=$(node -p -e \"require('./\"${{ steps.tag.outputs.service }}\"/package.json').version\")\" >> $GITHUB_OUTPUT\nelse \n if [[ \"${{ steps.tag.outputs.service }}\" == \"boot-api\" || \"${{ steps.tag.outputs.service }}\" == \"node\" || \"${{ steps.tag.outputs.service }}\" == \"por\" || \"${{ steps.tag.outputs.service }}\" == \"dal\" || \"${{ steps.tag.outputs.service }}\" == \"reporter\" || \"${{ steps.tag.outputs.service }}\" == \"logscribe\" || \"${{ steps.tag.outputs.service }}\" == \"sentinel\" || \"${{ steps.tag.outputs.service }}\" == \"delegator\" || \"${{ steps.tag.outputs.service }}\" == \"api\" ]]; then \n version=$(cat ./node/.version) \n else\n version=$(cat ./${{ steps.tag.outputs.service }}/.version)\n fi\n echo \"version=$version\" >> $GITHUB_OUTPUT\nfi\n"
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
build:
name: Build
runs-on: ubuntu-latest
needs: prepare
if: ${{ github.event.inputs.network == 'Baobab' && github.event.inputs.image == 'new' }}
permissions:
id-token: write
contents: read
outputs:
img_tag: ${{ steps.img-tag.outputs.img_tag }}
steps:
- uses: actions/checkout@master
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.3"
check-latest: true
cache-dependency-path: |
./${{ needs.prepare.outputs.service }}/go.sum
./${{ needs.prepare.outputs.service }}/go.mod
if: ${{ needs.prepare.outputs.service != 'core' || needs.prepare.outputs.service != 'fetcher' || needs.prepare.outputs.service != 'cli' }}
- name: docker build ${{ github.event.inputs.application }}
run: SERVICE_NAME=miko-${{ needs.prepare.outputs.service }} docker compose -f docker-compose.build.yaml build
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.ROLE_ARN }}
- name: login to amazon ecr
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: publish image to ecr
run: |
docker tag miko-${{ needs.prepare.outputs.service }} ${{ needs.prepare.outputs.ecr_url }}:latest
docker push ${{ needs.prepare.outputs.ecr_url }}:latest
docker tag ${{ needs.prepare.outputs.ecr_url }}:latest ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}
docker push ${{ needs.prepare.outputs.ecr_url }}:v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}
- name: image tag output
id: img-tag
run: echo "img_tag=v${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }}" >> $GITHUB_OUTPUT
post-slack-image-upload:
name: Slack message for image upload
needs: [prepare, build]
uses: ./.github/workflows/post.slack.yaml
with:
status: "Success"
slack-message: "${{ github.event.inputs.network }} ${{ github.event.inputs.application }}* : *${{ needs.prepare.outputs.service }}* ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is uploaded"
channel: "miko-notification"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ github.event.inputs.network == 'Baobab' && success() }}
image-update:
name: Update image tag
needs: [prepare, build]
uses: ./.github/workflows/update.image-tag.yaml
with:
network: "baobab"
project-name: ${{ github.event.inputs.application }}
version: ${{ needs.prepare.outputs.version }}
image-tag: ${{ needs.build.outputs.img_tag }}
tag_date: ${{ needs.prepare.outputs.tag_date }}
tag_git_hash: ${{ needs.prepare.outputs.tag_git_hash }}
secrets:
PAT: ${{ secrets.PAT }}
if: ${{ github.event.inputs.network == 'Baobab' && github.event.inputs.image == 'new' }}
post-slack-baobab-tag-update-success:
name: Post slack message for tag update success
needs: [prepare, build, image-update]
uses: ./.github/workflows/post.slack.yaml
with:
status: "Success"
slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* : *${{ needs.prepare.outputs.service }}* new image tag ${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.tag_date }}.${{ needs.prepare.outputs.tag_git_hash }} is updated"
channel: "miko-notification"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ github.event.inputs.network == 'Baobab' && github.event.inputs.image == 'new' && success() }}
cypress-image-update:
name: cypress image update
uses: ./.github/workflows/update.image-tag.yaml
with:
network: "cypress"
project-name: ${{ github.event.inputs.application }}
secrets:
PAT: ${{ secrets.PAT }}
if: ${{ github.event.inputs.network == 'Cypress' }}
post-slack-cypress-tag-update-success:
name: Post slack message for tag update success
needs: [cypress-image-update]
uses: ./.github/workflows/post.slack.yaml
with:
status: "Success"
slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* is updated"
channel: "miko-notification"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ github.event.inputs.network == 'Cypress' && success() }}
post-slack-tag-update-failure:
name: Post to a slack message for tag update failure
needs: [prepare, build, image-update]
uses: ./.github/workflows/post.slack.yaml
with:
status: "Failed"
slack-message: "${{ github.event.inputs.network }} *${{ github.event.inputs.application }}* git action failed"
channel: "miko-notification"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ github.event.inputs.network == 'Baobab' && github.event.inputs.image == 'new' && failure() }}
update-workflow-and-readme:
name: Update Workflow and README
needs: [prepare, build, image-update]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pages: write
outputs:
new_tag: ${{ steps.tag_info.outputs.NEW_TAG }}
pr_title: ${{ steps.pr_info.outputs.PR_TITLE }}
truncated_title: ${{ steps.truncate_pr_title.outputs.truncated_title }}
steps:
- uses: actions/checkout@master
with:
token: ${{ secrets.WORKFLOW_PAT }}
- name: get latest merged pull request
id: pr_info
run: |
pr=$(gh pr list --state merged --json title -L 1)
PR_TITLE=$(echo $pr | jq -r '.[0].title')
PR_TITLE=$(echo "${PR_TITLE}" | sed 's/\\/\\\\/g; s/"/\\"/g; s/`/\\`/g; s/\$/\\$/g')
PR_TITLE=$(echo "${PR_TITLE}" | sed 's/[^a-zA-Z0-9 ]//g')
echo "PR_TITLE=${PR_TITLE}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
- name: Install yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- name: truncate PR title
id: truncate_pr_title
run: "TR_PR_TITLE=\"${{steps.pr_info.outputs.PR_TITLE}}\"\nMAX_LENGTH=30\nif [ ${#TR_PR_TITLE} -gt $MAX_LENGTH ]; then\n TRUNCATED_TITLE=\"${TR_PR_TITLE:0:$MAX_LENGTH}...\"\nelse\n TRUNCATED_TITLE=\"$TR_PR_TITLE\"\nfi\necho \"truncated_title=$TRUNCATED_TITLE\" >> $GITHUB_OUTPUT \n"
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
- name: Update Workflow Dispatch Options
id: tag_info
run: |
# Update the deployment.yaml file with the new tag
git pull
# Get the new tag
NEW_TAG=${{ github.event.inputs.application }}:${{ needs.build.outputs.img_tag }}
TAG_WITH_DESCRIPTION="${NEW_TAG}:${{ steps.truncate_pr_title.outputs.truncated_title }}"
CURRENT_OPTIONS=$(yq e '.on.workflow_dispatch.inputs.image.options[]' .github/workflows/deployment.yaml | sed 's/^- //')
OPTIONS_ARRAY=()
while IFS= read -r line; do
OPTIONS_ARRAY+=("\"$line\"")
done <<< "$CURRENT_OPTIONS"
OPTIONS_ARRAY+=("\"$TAG_WITH_DESCRIPTION\"")
yq eval 'del(.on.workflow_dispatch.inputs.image.options)' -i .github/workflows/deployment.yaml
for option in "${OPTIONS_ARRAY[@]}"; do
yq eval ".on.workflow_dispatch.inputs.image.options += [$option]" -i .github/workflows/deployment.yaml
done
git add .github/workflows/deployment.yaml
env:
GH_TOKEN: ${{ secrets.WORKFLOW_PAT }}
- name: Update TAGS with Latest PR Info
run: |
echo "- **${{ github.event.inputs.application }}** ${{ needs.build.outputs.img_tag }} <br> *\`PR\`*: ${{steps.truncate_pr_title.outputs.truncated_title}} <br><br> " >> TAGS.md
git add TAGS.md
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.WORKFLOW_PAT }}
branch: ${{ github.ref }}
repository: ${{ github.repository }}
post-slack-pr-update:
name: Post to a slack message for tag update failure
needs: [prepare, build, image-update, update-workflow-and-readme]
uses: ./.github/workflows/post.image.slack.yaml
with:
slack-message: "\\n \\n> *Service:* ${{ github.event.inputs.application }} \\n> *Version:* ${{ needs.build.outputs.img_tag }} \\n> *PR:* ${{ needs.update-workflow-and-readme.outputs.pr_title}}"
channel: "orakl-images"
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: ${{ success() }}