@@ -37,10 +37,17 @@ jobs:
37
37
fetch-depth : 0
38
38
39
39
- name : Set up QEMU
40
- uses : docker/setup-qemu-action@v1
40
+ uses : docker/setup-qemu-action@v2
41
41
42
42
- name : Set up Docker Buildx
43
- uses : docker/setup-buildx-action@v1
43
+ uses : docker/setup-buildx-action@v2
44
+
45
+ - name : Login to DockerHub
46
+ if : ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
47
+ uses : docker/login-action@v2
48
+ with :
49
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
50
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
44
51
45
52
- name : Get version tag from github release
46
53
if : github.event_name == 'release' && github.event.action == 'created'
@@ -56,53 +63,44 @@ jobs:
56
63
run : |
57
64
echo "The version tag that will be published to docker hub is: ${{ env.opal_version_tag }}"
58
65
59
- - name : Build client
66
+ - name : Build client for testing
60
67
id : build_client
61
- uses : docker/build-push-action@v2
68
+ uses : docker/build-push-action@v4
62
69
with :
63
70
file : docker/Dockerfile
64
- platforms : linux/amd64,linux/arm64
65
71
push : false
66
72
target : client
67
73
cache-from : type=registry,ref=permitio/opal-client:latest
68
74
cache-to : type=inline
69
75
load : true
70
76
tags : |
71
77
permitio/opal-client:test
72
- permitio/opal-client:latest
73
- permitio/opal-client:${{ env.opal_version_tag }}
74
78
75
- - name : Build client-standalone
79
+ - name : Build client-standalone for testing
76
80
id : build_client_standalone
77
- uses : docker/build-push-action@v2
81
+ uses : docker/build-push-action@v4
78
82
with :
79
83
file : docker/Dockerfile
80
- platforms : linux/amd64,linux/arm64
81
84
push : false
82
85
target : client-standalone
83
86
cache-from : type=registry,ref=permitio/opal-client-standalone:latest
84
87
cache-to : type=inline
85
88
load : true
86
89
tags : |
87
90
permitio/opal-client-standalone:test
88
- permitio/opal-client-standalone:latest
89
- permitio/opal-client-standalone:${{ env.opal_version_tag }}
90
91
91
- - name : Build server
92
+ - name : Build server for testing
92
93
id : build_server
93
- uses : docker/build-push-action@v2
94
+ uses : docker/build-push-action@v4
94
95
with :
95
96
file : docker/Dockerfile
96
- platforms : linux/amd64,linux/arm64
97
97
push : false
98
98
target : server
99
99
cache-from : type=registry,ref=permitio/opal-server:latest
100
100
cache-to : type=inline
101
101
load : true
102
102
tags : |
103
103
permitio/opal-server:test
104
- permitio/opal-server:latest
105
- permitio/opal-server:${{ env.opal_version_tag }}
106
104
107
105
# TEST PHASE
108
106
- name : Create modified docker compose file
@@ -121,23 +119,49 @@ jobs:
121
119
- name : Output local docker images
122
120
run : docker image ls --digests | grep opal
123
121
124
- - name : Login to DockerHub
125
- if : ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
126
- uses : docker/login-action@v1
127
- with :
128
- username : ${{ secrets.DOCKERHUB_USERNAME }}
129
- password : ${{ secrets.DOCKERHUB_TOKEN }}
130
-
131
122
# pushes the *same* docker images that were previously tested as part of e2e sanity test.
132
123
# each image is pushed with the versioned tag first, if it succeeds the image is pushed with the latest tag as well.
133
- - name : Push client
124
+ - name : Build & Push client
134
125
if : ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
135
- run : docker push permitio/opal-client:${{ env.opal_version_tag }} && docker push permitio/opal-client:latest
126
+ id : build_push_client
127
+ uses : docker/build-push-action@v4
128
+ with :
129
+ file : docker/Dockerfile
130
+ platforms : linux/amd64,linux/arm64
131
+ push : true
132
+ target : client
133
+ cache-from : type=registry,ref=permitio/opal-client:latest
134
+ cache-to : type=inline
135
+ tags : |
136
+ permitio/opal-client:latest
137
+ permitio/opal-client:${{ env.opal_version_tag }}
136
138
137
- - name : Push client-standalone
139
+ - name : Build client-standalone
138
140
if : ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
139
- run : docker push permitio/opal-client-standalone:${{ env.opal_version_tag }} && docker push permitio/opal-client-standalone:latest
141
+ id : build_push_client_standalone
142
+ uses : docker/build-push-action@v4
143
+ with :
144
+ file : docker/Dockerfile
145
+ platforms : linux/amd64,linux/arm64
146
+ push : true
147
+ target : client-standalone
148
+ cache-from : type=registry,ref=permitio/opal-client-standalone:latest
149
+ cache-to : type=inline
150
+ tags : |
151
+ permitio/opal-client-standalone:latest
152
+ permitio/opal-client-standalone:${{ env.opal_version_tag }}
140
153
141
- - name : Push server
154
+ - name : Build server
142
155
if : ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
143
- run : docker push permitio/opal-server:${{ env.opal_version_tag }} && docker push permitio/opal-server:latest
156
+ id : build_push_server
157
+ uses : docker/build-push-action@v4
158
+ with :
159
+ file : docker/Dockerfile
160
+ platforms : linux/amd64,linux/arm64
161
+ push : true
162
+ target : server
163
+ cache-from : type=registry,ref=permitio/opal-server:latest
164
+ cache-to : type=inline
165
+ tags : |
166
+ permitio/opal-server:latest
167
+ permitio/opal-server:${{ env.opal_version_tag }}
0 commit comments