Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 19 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ on:
- '*'
workflow_dispatch:

env:
DOCKER_METADATA_SET_OUTPUT_ENV: 'true'

jobs:
verify:
retag:
runs-on: ubuntu-latest
outputs:
base_image: ${{ steps.get-base-image.outputs.tags }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -30,33 +37,13 @@ jobs:
tags: type=sha

- name: Verify that the image was previously built
run: docker pull "$BASE_IMAGE"
env:
BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }}

retag:
runs-on: ubuntu-latest
needs:
- verify
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
run: |
docker pull "$BASE_IMAGE"

- name: Produce release tags
id: meta
id: tag-meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
Expand All @@ -67,11 +54,9 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}

- name: Retag and push the image
uses: docker/build-push-action@v6
with:
cache-from: type=registry,ref=${{ needs.verify.outputs.base_image }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Retag the pulled image
env:
BASE_IMAGE: ${{ steps.get-base-image.outputs.tags }}
run: |
echo "$DOCKER_METADATA_OUTPUT_TAGS" | tr ' ' '\n' | xargs -n1 docker tag "$BASE_IMAGE"
docker push --all-tags "$(echo "$BASE_IMAGE" | cut -f1 -d:)"