@@ -20,12 +20,16 @@ name: General CI
20
20
# jobs that will always be executed:
21
21
# - fmt
22
22
# - set-condition
23
- # - parachain-build
23
+ # - parachain-build-dev
24
+ # - parachain-build-tee-prod
24
25
# - tee-build
25
26
#
26
27
# [4] please note that job-level if `env` is not supported:
27
28
# https://github.com/actions/runner/issues/1189
28
29
# as a workaround, we need to put it in a step-level or use `needs.outputs`
30
+ #
31
+ # [5] parachain-build-tee-prod builds the parachain image without `tee-dev` feature
32
+ # It's used with tee-worker production deployment with HW mode.
29
33
30
34
on :
31
35
push :
@@ -240,7 +244,7 @@ jobs:
240
244
if : failure()
241
245
uses : andymckay/cancel-action@0.3
242
246
243
- parachain-build :
247
+ parachain-build-dev :
244
248
runs-on : ubuntu-latest
245
249
needs :
246
250
- fmt
@@ -263,13 +267,49 @@ jobs:
263
267
264
268
- name : Save docker image
265
269
run : |
266
- docker save litentry/litentry-parachain -o litentry-parachain.tar
270
+ docker save litentry/litentry-parachain -o litentry-parachain-dev.tar
271
+
272
+ - name : Upload docker image
273
+ uses : actions/upload-artifact@v3
274
+ with :
275
+ name : parachain-artifact-dev
276
+ path : litentry-parachain-dev.tar
277
+ if-no-files-found : error
278
+
279
+ - name : Fail early
280
+ if : failure()
281
+ uses : andymckay/cancel-action@0.3
282
+
283
+ parachain-build-tee-prod :
284
+ runs-on : ubuntu-latest
285
+ needs :
286
+ - fmt
287
+ - set-condition
288
+ - sequentialise
289
+ steps :
290
+ - uses : actions/checkout@v3
291
+
292
+ - name : Build docker image
293
+ if : needs.set-condition.outputs.rebuild_parachain == 'true'
294
+ run : |
295
+ ./scripts/build-docker.sh production tee-prod
296
+ echo "============================="
297
+ docker images
298
+
299
+ - name : Pull docker image optinally
300
+ if : needs.set-condition.outputs.rebuild_parachain == 'false'
301
+ run : |
302
+ docker pull litentry/litentry-parachain:tee-prod
303
+
304
+ - name : Save docker image
305
+ run : |
306
+ docker save litentry/litentry-parachain:tee-prod -o litentry-parachain-tee-prod.tar
267
307
268
308
- name : Upload docker image
269
309
uses : actions/upload-artifact@v3
270
310
with :
271
- name : parachain-artifact
272
- path : litentry-parachain.tar
311
+ name : parachain-artifact-tee-prod
312
+ path : litentry-parachain-tee-prod .tar
273
313
if-no-files-found : error
274
314
275
315
- name : Fail early
@@ -350,7 +390,7 @@ jobs:
350
390
runs-on : ubuntu-latest
351
391
needs :
352
392
- set-condition
353
- - parachain-build
393
+ - parachain-build-dev
354
394
strategy :
355
395
matrix :
356
396
chain :
@@ -362,11 +402,11 @@ jobs:
362
402
363
403
- uses : actions/download-artifact@v3
364
404
with :
365
- name : parachain-artifact
405
+ name : parachain-artifact-dev
366
406
367
407
- name : Load docker image
368
408
run : |
369
- docker load -i litentry-parachain.tar
409
+ docker load -i litentry-parachain-dev .tar
370
410
371
411
- name : Run ts tests for ${{ matrix.chain }}
372
412
if : needs.set-condition.outputs.run_parachain_test == 'true'
@@ -454,7 +494,7 @@ jobs:
454
494
runs-on : ubuntu-latest
455
495
needs :
456
496
- set-condition
457
- - parachain-build
497
+ - parachain-build-dev
458
498
- tee-build
459
499
env :
460
500
WORKER_IMAGE_TAG : integritee-worker:dev
@@ -487,15 +527,15 @@ jobs:
487
527
488
528
- uses : actions/download-artifact@v3
489
529
with :
490
- name : parachain-artifact
530
+ name : parachain-artifact-dev
491
531
492
532
- uses : actions/download-artifact@v3
493
533
with :
494
534
name : tee-artifact
495
535
496
536
- name : Load docker image
497
537
run : |
498
- docker load -i litentry-parachain.tar
538
+ docker load -i litentry-parachain-dev .tar
499
539
docker load -i litentry-tee.tar
500
540
501
541
- name : Re-name Image Tags
@@ -561,20 +601,26 @@ jobs:
561
601
needs :
562
602
- set-condition
563
603
- parachain-ts-test
604
+ - parachain-build-tee-prod
564
605
- tee-test
565
606
if : ${{ !failure() && needs.set-condition.outputs.push_docker == 'true' }}
566
607
steps :
567
608
- uses : actions/download-artifact@v3
568
609
with :
569
- name : parachain-artifact
610
+ name : parachain-artifact-dev
611
+
612
+ - uses : actions/download-artifact@v3
613
+ with :
614
+ name : parachain-artifact-tee-prod
570
615
571
616
- uses : actions/download-artifact@v3
572
617
with :
573
618
name : tee-artifact
574
619
575
620
- name : Load docker image
576
621
run : |
577
- docker load -i litentry-parachain.tar
622
+ docker load -i litentry-parachain-dev.tar
623
+ docker load -i litentry-parachain-tee-prod.tar
578
624
docker load -i litentry-tee.tar
579
625
580
626
- name : Dockerhub login
@@ -583,13 +629,19 @@ jobs:
583
629
username : ${{ secrets.DOCKERHUB_USERNAME }}
584
630
password : ${{ secrets.DOCKERHUB_PASSWORD }}
585
631
586
- # only push the docker image if we rebuilt it
632
+ # only push `litentry/litentry-parachain` if we rebuilt it
587
633
- name : Push parachain image
588
634
if : needs.set-condition.outputs.rebuild_parachain == 'true'
589
635
run : |
590
636
docker push litentry/litentry-parachain
591
637
592
- # only push the docker image if we rebuilt it
638
+ # only push `litentry/litentry-parachain:tee-prod` if we rebuilt it
639
+ - name : Push parachain image
640
+ if : needs.set-condition.outputs.rebuild_parachain == 'true'
641
+ run : |
642
+ docker push litentry/litentry-parachain:tee-prod
643
+
644
+ # only push TEE images if we rebuilt them
593
645
- name : Push tee-worker image
594
646
if : needs.set-condition.outputs.rebuild_tee == 'true'
595
647
run : |
0 commit comments