18
18
jobs :
19
19
build-docker-images :
20
20
runs-on : ubuntu-20.04
21
- if : github.event_name == 'pull_request' && github.event.action == 'opened'
21
+ if : github.event_name == 'pull_request' && ( github.event.action == 'opened' || github.event.action == 'edited')
22
22
steps :
23
23
- name : Pull main repository
24
24
uses : actions/checkout@v3
@@ -28,11 +28,13 @@ jobs:
28
28
- name : Build docker images
29
29
run : |
30
30
cd docker/enclave-base
31
- docker build -t fortanix/enclave-base .
31
+ TAG=$(cat tag.txt)
32
+ docker build -t fortanix/enclave-base:$TAG .
32
33
docker save -o /tmp/enclave-base.tar fortanix/enclave-base
33
34
34
35
cd ../parent-base
35
- docker build -t fortanix/parent-base .
36
+ TAG=$(cat tag.txt)
37
+ docker build -t fortanix/parent-base:$TAG .
36
38
docker save -o /tmp/parent-base.tar fortanix/parent-base
37
39
38
40
- name : Upload enclave-base artifact
@@ -57,26 +59,23 @@ jobs:
57
59
with :
58
60
name : enclave-base
59
61
path : /tmp/enclave-base
60
- - name : Load enclave-base image
61
- run : |
62
- docker load --input /tmp/enclave-base/enclave-base.tar
63
62
64
63
- name : Download parent-base artifact
65
64
uses : actions/download-artifact@v3
66
65
with :
67
66
name : parent-base
68
67
path : /tmp/parent-base
69
- - name : Load parent-base image
70
- run : |
71
- docker load --input /tmp/parent-base/parent-base.tar
72
68
73
69
- name : Login to Docker Hub
74
70
uses : docker/login-action@v1
75
71
with :
76
72
username : ${{ secrets.DOCKER_USERNAME }}
77
73
password : ${{ secrets.DOCKER_PASSWORD }}
78
74
79
- - name : Push docker images
75
+ - name : Load and push docker images
80
76
run : |
81
- docker push fortanix/enclave-base
82
- docker push fortanix/parent-base
77
+ enclave_base_load_output = docker load --input /tmp/enclave-base/enclave-base.tar
78
+ parent_base_load_output = docker load --input /tmp/parent-base/parent-base.tar
79
+
80
+ docker push $(echo "enclave_base_load_output" | awk '{print $3}')
81
+ docker push $(echo "parent_base_load_output" | awk '{print $3}')
0 commit comments