@@ -4,10 +4,12 @@ name: Build the ambit-docker images
44on : # yamllint disable-line rule:truthy
55 workflow_dispatch :
66 repository_dispatch :
7- types : [ambit-repo-push]
7+ types :
8+ - ambit-repo-push
89 push :
910 branches :
1011 - master
12+ - ci-updates
1113
1214jobs :
1315
2123 steps :
2224
2325 - name : Checkout the repository
24- uses : actions/checkout@v3
26+ uses : actions/checkout@v6.0.1
2527
2628 - name : Determining the RDBMS test matrix
2729 id : db
@@ -48,14 +50,15 @@ jobs:
4850 war_db="$( awk "${awk_get_war_from_db}" '${{ env.prefix }}/tags.txt')"
4951 echo "war-db=${war_db}" >> $GITHUB_OUTPUT
5052
53+
5154 build-ambit :
5255
5356 needs : [set-test-matrices]
5457 runs-on : ubuntu-latest
5558 strategy :
5659 matrix :
57- java-distribution : ['temurin', 'zulu ']
58- java-version : [8, 11, 17]
60+ java-distribution : ['temurin', 'corretto ']
61+ java-version : [8, 11, 17, 21, 25 ]
5962 rdbms-version : ${{ fromJson(needs.set-test-matrices.outputs.matrix-db) }}
6063 fail-fast : false
6164 env :
@@ -66,14 +69,14 @@ jobs:
6669 steps :
6770
6871 - name : Checkout the AMBIT repository
69- uses : actions/checkout@v3
72+ uses : actions/checkout@v6.0.1
7073 with :
7174 repository : ideaconsult/ambit-mirror
7275 ref : ${{ github.event.client_payload.sha }}
7376 token : ${{ secrets.GH_R_PR }}
7477
7578 - name : ' Set up OpenJDK: ${{ matrix.java-distribution }}/${{ matrix.java-version }}'
76- uses : actions/setup-java@v3
79+ uses : actions/setup-java@v5.1.0
7780 with :
7881 distribution : ${{ matrix.java-distribution }}
7982 java-version : ${{ matrix.java-version }}
9194 ln -s -t /usr/bin "/opt/apache-maven-${maven_version}/bin/mvn"
9295
9396 - name : Cache the local Maven repository
94- uses : actions/cache@v3
97+ uses : actions/cache@v4.3.0
9598 with :
9699 path : ~/.m2/repository
97100 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -184,14 +187,18 @@ jobs:
184187 run : docker stop "${rdbms_ctnr_name}"
185188
186189 - name : Save the newly build WAR
187- # Only the one tested with the RDBMS marked with our "latest" image tag
188- if : ${{ matrix.rdbms-version == needs.set-test-matrices.outputs.war-db }}
189- uses : actions/upload-artifact@v3
190+ # Only the one tested with the RDBMS marked with our "latest" image tag,
191+ # and only for the Java distribution that we build our images with.
192+ if : >
193+ matrix.rdbms-version == needs.set-test-matrices.outputs.war-db &&
194+ matrix.java-distribution == 'temurin'
195+ uses : actions/upload-artifact@v5.0.0
190196 with :
191197 name : ambit-war-java${{ matrix.java-version }}
192198 path : ambit2-apps/ambit2-www/target/ambit2.war
193199 retention-days : 1
194200
201+
195202 set-build-matrices :
196203
197204 runs-on : ubuntu-latest
@@ -203,7 +210,7 @@ jobs:
203210 steps :
204211
205212 - name : Checkout the repository
206- uses : actions/checkout@v3
213+ uses : actions/checkout@v6.0.1
207214
208215 - name : Determining the ambit-api build matrix
209216 id : api
@@ -225,6 +232,7 @@ jobs:
225232 jq . <<<"$matrix_json" # lint
226233 echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT
227234
235+
228236 build-images-api :
229237
230238 needs : [build-ambit, set-build-matrices]
@@ -239,15 +247,15 @@ jobs:
239247 steps :
240248
241249 - name : Checkout the repository
242- uses : actions/checkout@v3
250+ uses : actions/checkout@v6.0.1
243251
244252 - name : Identify the OpenJDK version
245253 run : |
246254 export java_version="$(echo ${{ matrix.ver }} | sed 's|.*-jdk\([[:digit:]]\+\)-.*|\1|')"
247255 echo "java_version=${java_version}" >>"$GITHUB_ENV"
248256
249257 - name : Load the latest WAR for the required OpenJDK version
250- uses : actions/download-artifact@v3
258+ uses : actions/download-artifact@v6.0.0
251259 with :
252260 name : ambit-war-java${{ env.java_version }}
253261 path : ./ci/${{ env.image }}/${{ matrix.ver }}
@@ -264,29 +272,38 @@ jobs:
264272 echo "image_tags=${tags_list:1}" >>"$GITHUB_ENV"
265273
266274 - name : Set up Docker Buildx
267- uses : docker/setup-buildx-action@v2
275+ uses : docker/setup-buildx-action@v3.11.1
268276
269277 - name : Log in to GitHub Container Registry
270- uses : docker/login-action@v2
278+ uses : docker/login-action@v3.6.0
271279 with :
272280 registry : ghcr.io
273- username : idea-docker
274- password : ${{ secrets.GH_CR_FA }}
281+ username : ${{ github.actor }}
282+ password : ${{ secrets.GITHUB_TOKEN }}
275283
276284 - name : Log in to Docker Hub
277- uses : docker/login-action@v2
285+ uses : docker/login-action@v3.6.0
278286 with :
279- username : kerberizer
287+ username : ${{ secrets.DCKR_USER }}
280288 password : ${{ secrets.DCKR_TOKEN }}
281289
282290 - name : Build the ambit-api image
283- uses : docker/build-push-action@v4
291+ uses : docker/build-push-action@v6.18.0
284292 with :
285293 context : ./ci/${{ env.image }}/${{ matrix.ver }}
294+ outputs : type=docker,dest=ambit-api.${{ matrix.ver }}.docker.tar
286295 pull : true
287296 push : ${{ github.ref == 'refs/heads/master' }} # push only if we're on the master branch
288297 tags : ${{ env.image_tags }}
289298
299+ - name : Upload the built image as artifact for download
300+ uses : actions/upload-artifact@v5.0.0
301+ with :
302+ name : ambit-api.${{ matrix.ver }}.docker.tar
303+ path : ambit-api.${{ matrix.ver }}.docker.tar
304+ retention-days : 3
305+
306+
290307 build-images-db :
291308
292309 needs : set-build-matrices
@@ -301,7 +318,7 @@ jobs:
301318 steps :
302319
303320 - name : Checkout the repository
304- uses : actions/checkout@v3
321+ uses : actions/checkout@v6.0.1
305322
306323 - name : Determine the image tags
307324 run : >-
@@ -315,29 +332,38 @@ jobs:
315332 echo "image_tags=${tags_list:1}" >>"$GITHUB_ENV"
316333
317334 - name : Set up Docker Buildx
318- uses : docker/setup-buildx-action@v2
335+ uses : docker/setup-buildx-action@v3.11.1
319336
320337 - name : Log in to GitHub Container Registry
321- uses : docker/login-action@v2
338+ uses : docker/login-action@v3.6.0
322339 with :
323340 registry : ghcr.io
324- username : idea-docker
325- password : ${{ secrets.GH_CR_FA }}
341+ username : ${{ github.actor }}
342+ password : ${{ secrets.GITHUB_TOKEN }}
326343
327344 - name : Log in to Docker Hub
328- uses : docker/login-action@v2
345+ uses : docker/login-action@v3.6.0
329346 with :
330- username : kerberizer
347+ username : ${{ secrets.DCKR_USER }}
331348 password : ${{ secrets.DCKR_TOKEN }}
332349
333350 - name : Build the ambit-db image
334- uses : docker/build-push-action@v4
351+ uses : docker/build-push-action@v6.18.0
335352 with :
336353 context : ./ci/${{ env.image }}/${{ matrix.ver }}
354+ outputs : type=docker,dest=ambit-db.${{ matrix.ver }}.docker.tar
337355 pull : true
338356 push : ${{ github.ref == 'refs/heads/master' }} # push only if we're on the master branch
339357 tags : ${{ env.image_tags }}
340358
359+ - name : Upload the built image as artifact for download
360+ uses : actions/upload-artifact@v5.0.0
361+ with :
362+ name : ambit-db.${{ matrix.ver }}.docker.tar
363+ path : ambit-db.${{ matrix.ver }}.docker.tar
364+ retention-days : 3
365+
366+
341367 integration-testing :
342368
343369 needs : [build-images-api, build-images-db]
@@ -346,12 +372,12 @@ jobs:
346372 steps :
347373
348374 - name : Checkout the repository
349- uses : actions/checkout@v3
375+ uses : actions/checkout@v6.0.1
350376
351- - name : Spin up a default docker-compose setup
377+ - name : Spin up a default Docker Compose setup
352378 run : |
353- docker- compose pull
354- docker- compose up --detach
379+ docker compose pull
380+ docker compose up --detach
355381
356382 - name : Wait for the API to become operational
357383 run : |
@@ -363,8 +389,8 @@ jobs:
363389 - name : Run the API tests
364390 run : ./ci/run_integration_tests.sh
365391
366- - name : Bring down the docker-compose setup
367- run : docker- compose down --volumes
392+ - name : Bring down the Docker Compose setup
393+ run : docker compose down --volumes
368394
369395# FIXME: Temporarily not sending notifications to Discord until we manage to send the final status.
370396# send-notifications:
0 commit comments