@@ -112,19 +112,31 @@ jobs:
112112 - name : Skip message
113113 if : steps.check.outputs.build_needed == 'false'
114114 run : echo "No changes in gatewayApi, skipping build"
115- - uses : docker/build-push-action@v1
115+ - name : Sanitize tag name
116116 if : steps.check.outputs.build_needed == 'true'
117+ id : tag
118+ run : echo "tag=$(echo '${{ github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT
119+ - name : Set up Docker Buildx
120+ if : steps.check.outputs.build_needed == 'true'
121+ uses : docker/setup-buildx-action@v3
122+ - name : Log in to GitHub Container Registry
123+ if : steps.check.outputs.build_needed == 'true'
124+ uses : docker/login-action@v3
117125 with :
118- registry : docker.pkg.github.com
119- username : $GITHUB_ACTOR
126+ registry : ghcr.io
127+ username : ${{ github.actor }}
120128 password : ${{ secrets.GITHUB_TOKEN }}
121- repository : bcgov/gwa-api/gwa-gateway-api
122- path : microservices/gatewayApi
123- dockerfile : microservices/gatewayApi/Dockerfile
124- tag_with_ref : true
125- tag_with_sha : false
126- add_git_labels : true
129+ logout : false
130+ - uses : docker/build-push-action@v5
131+ if : steps.check.outputs.build_needed == 'true'
132+ with :
133+ context : microservices/gatewayApi
134+ file : microservices/gatewayApi/Dockerfile
127135 push : true
136+ tags : ghcr.io/bcgov/gwa-api/gwa-gateway-api:${{ steps.tag.outputs.tag }}
137+ labels : |
138+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
139+ org.opencontainers.image.revision=${{ github.sha }}
128140
129141 gwa-scheduler :
130142 needs : sonar-scan
@@ -145,19 +157,31 @@ jobs:
145157 - name : Skip message
146158 if : steps.check.outputs.build_needed == 'false'
147159 run : echo "No changes in gatewayJobScheduler, skipping build"
148- - uses : docker/build-push-action@v1
160+ - name : Sanitize tag name
161+ if : steps.check.outputs.build_needed == 'true'
162+ id : tag
163+ run : echo "tag=$(echo '${{ github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT
164+ - name : Set up Docker Buildx
149165 if : steps.check.outputs.build_needed == 'true'
166+ uses : docker/setup-buildx-action@v3
167+ - name : Log in to GitHub Container Registry
168+ if : steps.check.outputs.build_needed == 'true'
169+ uses : docker/login-action@v3
150170 with :
151- registry : docker.pkg.github.com
152- username : $GITHUB_ACTOR
171+ registry : ghcr.io
172+ username : ${{ github.actor }}
153173 password : ${{ secrets.GITHUB_TOKEN }}
154- repository : bcgov/gwa-api/gwa-scheduler
155- path : microservices/gatewayJobScheduler
156- dockerfile : microservices/gatewayJobScheduler/Dockerfile
157- tag_with_ref : true
158- tag_with_sha : false
159- add_git_labels : true
174+ logout : false
175+ - uses : docker/build-push-action@v5
176+ if : steps.check.outputs.build_needed == 'true'
177+ with :
178+ context : microservices/gatewayJobScheduler
179+ file : microservices/gatewayJobScheduler/Dockerfile
160180 push : true
181+ tags : ghcr.io/bcgov/gwa-api/gwa-scheduler:${{ steps.tag.outputs.tag }}
182+ labels : |
183+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
184+ org.opencontainers.image.revision=${{ github.sha }}
161185
162186 gwa-kube-api :
163187 needs : sonar-scan
@@ -178,19 +202,31 @@ jobs:
178202 - name : Skip message
179203 if : steps.check.outputs.build_needed == 'false'
180204 run : echo "No changes in kubeApi, skipping build"
181- - uses : docker/build-push-action@v1
205+ - name : Sanitize tag name
206+ if : steps.check.outputs.build_needed == 'true'
207+ id : tag
208+ run : echo "tag=$(echo '${{ github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT
209+ - name : Set up Docker Buildx
210+ if : steps.check.outputs.build_needed == 'true'
211+ uses : docker/setup-buildx-action@v3
212+ - name : Log in to GitHub Container Registry
182213 if : steps.check.outputs.build_needed == 'true'
214+ uses : docker/login-action@v3
183215 with :
184- registry : docker.pkg.github.com
185- username : $GITHUB_ACTOR
216+ registry : ghcr.io
217+ username : ${{ github.actor }}
186218 password : ${{ secrets.GITHUB_TOKEN }}
187- repository : bcgov/gwa-api/gwa-kube-api
188- path : microservices/kubeApi
189- dockerfile : microservices/kubeApi/Dockerfile
190- tag_with_ref : true
191- tag_with_sha : false
192- add_git_labels : true
219+ logout : false
220+ - uses : docker/build-push-action@v5
221+ if : steps.check.outputs.build_needed == 'true'
222+ with :
223+ context : microservices/kubeApi
224+ file : microservices/kubeApi/Dockerfile
193225 push : true
226+ tags : ghcr.io/bcgov/gwa-api/gwa-kube-api:${{ steps.tag.outputs.tag }}
227+ labels : |
228+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
229+ org.opencontainers.image.revision=${{ github.sha }}
194230
195231 gwa-compatibility-api :
196232 needs : sonar-scan
@@ -211,19 +247,31 @@ jobs:
211247 - name : Skip message
212248 if : steps.check.outputs.build_needed == 'false'
213249 run : echo "No changes in compatibilityApi, skipping build"
214- - uses : docker/build-push-action@v1
250+ - name : Sanitize tag name
251+ if : steps.check.outputs.build_needed == 'true'
252+ id : tag
253+ run : echo "tag=$(echo '${{ github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT
254+ - name : Set up Docker Buildx
215255 if : steps.check.outputs.build_needed == 'true'
256+ uses : docker/setup-buildx-action@v3
257+ - name : Log in to GitHub Container Registry
258+ if : steps.check.outputs.build_needed == 'true'
259+ uses : docker/login-action@v3
216260 with :
217- registry : docker.pkg.github.com
218- username : $GITHUB_ACTOR
261+ registry : ghcr.io
262+ username : ${{ github.actor }}
219263 password : ${{ secrets.GITHUB_TOKEN }}
220- repository : bcgov/gwa-api/gwa-compatibility-api
221- path : microservices/compatibilityApi
222- dockerfile : microservices/compatibilityApi/Dockerfile
223- tag_with_ref : true
224- tag_with_sha : false
225- add_git_labels : true
264+ logout : false
265+ - uses : docker/build-push-action@v5
266+ if : steps.check.outputs.build_needed == 'true'
267+ with :
268+ context : microservices/compatibilityApi
269+ file : microservices/compatibilityApi/Dockerfile
226270 push : true
271+ tags : ghcr.io/bcgov/gwa-api/gwa-compatibility-api:${{ steps.tag.outputs.tag }}
272+ labels : |
273+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
274+ org.opencontainers.image.revision=${{ github.sha }}
227275
228276 gwa-csit-oas-validation-api :
229277 needs : sonar-scan
@@ -244,16 +292,28 @@ jobs:
244292 - name : Skip message
245293 if : steps.check.outputs.build_needed == 'false'
246294 run : echo "No changes in csitOasValidationApi, skipping build"
247- - uses : docker/build-push-action@v1
295+ - name : Sanitize tag name
296+ if : steps.check.outputs.build_needed == 'true'
297+ id : tag
298+ run : echo "tag=$(echo '${{ github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT
299+ - name : Set up Docker Buildx
300+ if : steps.check.outputs.build_needed == 'true'
301+ uses : docker/setup-buildx-action@v3
302+ - name : Log in to GitHub Container Registry
248303 if : steps.check.outputs.build_needed == 'true'
304+ uses : docker/login-action@v3
249305 with :
250- registry : docker.pkg.github.com
251- username : $GITHUB_ACTOR
306+ registry : ghcr.io
307+ username : ${{ github.actor }}
252308 password : ${{ secrets.GITHUB_TOKEN }}
253- repository : bcgov/gwa-api/gwa-csit-oas-validation-api
254- path : microservices/csitOasValidationApi
255- dockerfile : microservices/csitOasValidationApi/Dockerfile
256- tag_with_ref : true
257- tag_with_sha : false
258- add_git_labels : true
309+ logout : false
310+ - uses : docker/build-push-action@v5
311+ if : steps.check.outputs.build_needed == 'true'
312+ with :
313+ context : microservices/csitOasValidationApi
314+ file : microservices/csitOasValidationApi/Dockerfile
259315 push : true
316+ tags : ghcr.io/bcgov/gwa-api/gwa-csit-oas-validation-api:${{ steps.tag.outputs.tag }}
317+ labels : |
318+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
319+ org.opencontainers.image.revision=${{ github.sha }}
0 commit comments