From dcb7e93b0206875f019041ca11ac5d55339603e3 Mon Sep 17 00:00:00 2001 From: Akshay Karle <1443108+akshaykarle@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:12:56 +0100 Subject: [PATCH] fix docker label for non latest image * Also adds QEMU and buildx as recommended in https://github.com/docker/build-push-action?tab=readme-ov-file#usage --- .github/workflows/publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6854c03..ad6be26 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,8 +47,12 @@ jobs: - uses: DeterminateSystems/flake-checker-action@main - name: Build image run: nix build .#dockerImage + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -64,5 +68,5 @@ jobs: docker load --input result docker tag pii:latest ${{ format('{0}/{1}:latest', env.REGISTRY, env.IMAGE_NAME) }} docker push ${{ format('{0}/{1}:latest', env.REGISTRY, env.IMAGE_NAME) }} - docker tag pii:latest ${{ format('{0}/{1}:{2}', env.REGISTRY, env.IMAGE_NAME, steps.meta.outputs.tags) }} - docker push ${{ format('{0}/{1}:{2}', env.REGISTRY, env.IMAGE_NAME, steps.meta.outputs.tags) }} + docker tag pii:latest ${{ steps.meta.outputs.tags }} + docker push ${{ steps.meta.outputs.tags }}