From c8e774e1282cd5a27ddb73d764de69742733dd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0ari=C4=87?= Date: Sun, 24 Dec 2023 18:11:04 +0100 Subject: [PATCH] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a7a09f7..35825d4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -17,7 +17,9 @@ env: # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io # github.repository as / - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME_ARM64: ${{ github.repository }}:${{ github.ref_name }}-arm64 + + IMAGE_NAME_AMD64: ${{ github.repository }}:${{ github.ref_name }}-amd64 jobs: @@ -62,10 +64,16 @@ jobs: # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata - id: meta + id: meta-arm64 + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_ARM64 }} + + - name: Extract Docker metadata + id: meta-amd64 uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_AMD64 }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action @@ -76,8 +84,8 @@ jobs: context: . file: dockerfile-arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-arm64.outputs.tags }} + labels: ${{ steps.meta-arm64.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/arm64 @@ -89,8 +97,8 @@ jobs: context: . file: dockerfile-amd64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-amd64.outputs.tags }} + labels: ${{ steps.meta-amd64.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64