Skip to content

Commit 74127b1

Browse files
committed
Update actions in Docker image publishing
Use `docker/build-push-action` instead of `elgohr/Publish-Docker-Github-Action` and bump other related actions.
1 parent 11c6f0c commit 74127b1

File tree

4 files changed

+208
-135
lines changed

4 files changed

+208
-135
lines changed

.github/workflows.src/build.inc.yml

+53-39
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,23 @@
378378
ref: master
379379
path: dockerfile
380380

381+
- name: Login to Docker Hub
382+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
383+
with:
384+
username: ${{ secrets.DOCKER_USERNAME }}
385+
password: ${{ secrets.DOCKER_PASSWORD }}
386+
387+
- name: Login to GitHub Container Registry
388+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
389+
with:
390+
registry: ghcr.io
391+
username: "edgedb-ci"
392+
password: ${{ secrets.GITHUB_CI_BOT_TOKEN }}
393+
381394
- env:
382395
VERSION_SLOT: "${{ << pub_outputs >>.version-slot }}"
383396
VERSION_CORE: "${{ << pub_outputs >>.version-core }}"
397+
CATALOG_VERSION: "${{ << pub_outputs >>.catalog-version }}"
384398
PKG_SUBDIST: "<< subdist >>"
385399
id: tags
386400
run: |
@@ -398,61 +412,61 @@
398412
done | grep "^[[:digit:]]\+.*" | grep -v "alpha\|beta\|rc" || :
399413
)
400414
401-
tags=( "$VERSION_CORE" )
415+
tags=()
402416
403-
top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \
404-
| grep "^${VERSION_SLOT}[\.-]" \
405-
| sort --version-sort --reverse | head -n 1)
406-
if [ "$top" == "$VERSION_CORE" ]; then
407-
tags+=( "$VERSION_SLOT" )
408-
fi
417+
if [ "$PKG_SUBDIST" = "nightly" ]; then
418+
tags+=(
419+
"nightly"
420+
"nightly_${VERSION_SLOT}_cv${CATALOG_VERSION}"
421+
)
422+
else
423+
tags+=( "$VERSION_CORE" )
409424
410-
if [ -z "$PKG_SUBDIST" ]; then
411425
top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \
426+
| grep "^${VERSION_SLOT}[\.-]" \
412427
| sort --version-sort --reverse | head -n 1)
413428
if [ "$top" == "$VERSION_CORE" ]; then
414-
tags+=( "latest" )
429+
tags+=( "$VERSION_SLOT" )
430+
fi
431+
432+
if [ -z "$PKG_SUBDIST" ]; then
433+
top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \
434+
| sort --version-sort --reverse | head -n 1)
435+
if [ "$top" == "$VERSION_CORE" ]; then
436+
tags+=( "latest" )
437+
fi
415438
fi
416439
fi
417440
441+
fq_tags=()
442+
images=("geldata/gel" "ghcr.io/geldata/gel")
443+
444+
for image in "${images[@]}"; do
445+
fq_tags+=("${tags[@]/#/$image}")
446+
done
447+
418448
IFS=,
419-
echo "tags=${tags[*]}" >> $GITHUB_OUTPUT
449+
echo "tags=${fq_tags[*]}" >> $GITHUB_OUTPUT
420450
421451
- name: Set up QEMU
422-
uses: docker/setup-qemu-action@v2
452+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
423453

424454
- name: Set up Docker Buildx
425-
uses: docker/setup-buildx-action@edfb0fe6204400c56fbfd3feba3fe9ad1adfa345 # v3
455+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
426456

427-
- name: Publish Docker Image (docker.io)
428-
uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5
457+
- name: Build and Publish Docker Image
458+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.10.0
429459
with:
430-
name: geldata/gel
431-
username: ${{ secrets.DOCKER_USERNAME }}
432-
password: ${{ secrets.DOCKER_PASSWORD }}
433-
<%- if subdist == "nightly" %>
434-
tags: "nightly,nightly_${{ << pub_outputs >>.version-slot }}_cv${{ << pub_outputs >>.catalog-version }}"
435-
<%- else %>
460+
push: true
461+
provenance: mode=max
436462
tags: "${{ steps.tags.outputs.tags }}"
437-
<%- endif %>
438-
workdir: dockerfile
439-
buildargs: branding=gel,version=${{ << pub_outputs >>.version-slot }},exact_version=${{ << pub_outputs >>.version-core }}<% if subdist != "" %>,subdist=<< subdist >><% endif %>
440-
platforms: << docker_tgts|map(attribute="docker_arch")|join(",") >>
441-
442-
- name: Publish Docker Image (ghcr.io)
443-
uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5
444-
with:
445-
registry: ghcr.io
446-
name: ${{ github.repository }}
447-
username: "edgedb-ci"
448-
password: ${{ secrets.GITHUB_CI_BOT_TOKEN }}
449-
<%- if subdist == "nightly" %>
450-
tags: "nightly,nightly_${{ << pub_outputs >>.version-slot }}_cv${{ << pub_outputs >>.catalog-version }}"
451-
<%- else %>
452-
tags: "${{ steps.tags.outputs.tags }}"
453-
<%- endif %>
454-
workdir: dockerfile
455-
buildargs: branding=gel,version=${{ << pub_outputs >>.version-slot }},exact_version=${{ << pub_outputs >>.version-core }}<% if subdist != "" %>,subdist=<< subdist >><% endif %>
463+
context: dockerfile
464+
build-args: |
465+
version=${{ << pub_outputs >>.version-slot }}
466+
exact_version=${{ << pub_outputs >>.version-core }}
467+
<%- if subdist != "" %>
468+
subdist=<< subdist >>
469+
<%- endif %>
456470
platforms: << docker_tgts|map(attribute="docker_arch")|join(",") >>
457471
<%- endif %>
458472

.github/workflows/nightly.yml

+54-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.yml

+50-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)