From bc3ee1947240b292c2bd7933de6fb4fe9cabc31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 16:17:42 +0100 Subject: [PATCH 01/18] Try new publish workflow --- .github/workflows/publish_docker.yml | 58 ++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 753bf033..f6ddff8e 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -15,8 +15,12 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - build-and-push-image: - runs-on: ubuntu-latest + build: + strategy: + matrix: + os: ["ubuntu-latest", "ubuntu-24.04-arm"] + runs-on: ${{ matrix.os }} + permissions: contents: read packages: write @@ -38,11 +42,19 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set architecture tag (amd64) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: echo "ARCH_TAG=amd64" >> $GITHUB_ENV + + - name: Set architecture tag (arm64) + if: ${{ contains(matrix.os, 'arm') }} + run: echo "ARCH_TAG=arm64" >> $GITHUB_ENV + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.os }} - name: Build Docker image uses: docker/build-push-action@v6 @@ -54,14 +66,36 @@ jobs: platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + outputs: type=docker, dest=${{ runner.temp }}/image.tar - - name: Build (arm) and push (amd/arm) Docker image - uses: docker/build-push-action@v6 - if: github.event_name == 'push' + - name: Upload artifact + uses: actions/upload-artifact@v4 with: - context: . - push: true - file: docker/Dockerfile - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + name: ${{ matrix.os}} + path: ${{ runner.temp }}/image.tar + + push: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download (AMD) artifact + uses: actions/download-artifact@v4 + with: + name: "ubuntu-latest" + path: ${{ runner.temp }} + + - name: Load image (amd) + run: | + docker load --input ${{ runner.temp }}/ubuntu-latest.tar + docker image ls -a + + - name: Download (ARM) artifact + uses: actions/download-artifact@v4 + with: + name: "ubuntu-24.04-arm" + path: ${{ runner.temp }} + + - name: Load image (arm) + run: | + docker load --input ${{ runner.temp }}/ubuntu-24.04-arm.tar + docker image ls -a From 9a1fbfd55317e8317b0195ed377d601f0c914361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 16:24:38 +0100 Subject: [PATCH 02/18] Fix platform choice --- .github/workflows/publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index f6ddff8e..a6b1b880 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -63,7 +63,7 @@ jobs: load: true push: false file: docker/Dockerfile - platforms: linux/amd64 + platforms: linux/${{ env.ARCH_TAG }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} outputs: type=docker, dest=${{ runner.temp }}/image.tar From 7795825fa8c78f7f026a259cc278b004390d1885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 16:43:32 +0100 Subject: [PATCH 03/18] Update workflow to merge artifacts to one place --- .github/workflows/publish_docker.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index a6b1b880..d20bf292 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -18,7 +18,7 @@ jobs: build: strategy: matrix: - os: ["ubuntu-latest", "ubuntu-24.04-arm"] + os: ["ubuntu-24.04", "ubuntu-24.04-arm"] runs-on: ${{ matrix.os }} permissions: @@ -43,7 +43,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Set architecture tag (amd64) - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-24.04' }} run: echo "ARCH_TAG=amd64" >> $GITHUB_ENV - name: Set architecture tag (arm64) @@ -78,24 +78,15 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - name: Download (AMD) artifact + - name: Download artifacts uses: actions/download-artifact@v4 with: - name: "ubuntu-latest" - path: ${{ runner.temp }} - - - name: Load image (amd) - run: | - docker load --input ${{ runner.temp }}/ubuntu-latest.tar - docker image ls -a - - - name: Download (ARM) artifact - uses: actions/download-artifact@v4 - with: - name: "ubuntu-24.04-arm" + merge-multiple: true + name: "ubuntu-*.tar" path: ${{ runner.temp }} - name: Load image (arm) run: | docker load --input ${{ runner.temp }}/ubuntu-24.04-arm.tar + docker load --input ${{ runner.temp }}/ubuntu-24.04.tar docker image ls -a From 8cd56120318b9fae9e140737486d6b21aa16e4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 16:44:22 +0100 Subject: [PATCH 04/18] Set retention days to minimum --- .github/workflows/publish_docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index d20bf292..63fc3638 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -73,6 +73,7 @@ jobs: with: name: ${{ matrix.os}} path: ${{ runner.temp }}/image.tar + retention-days: 1 push: runs-on: ubuntu-latest From 0347f78098d2acca15fc66562082e7dcd8a13945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 16:52:41 +0100 Subject: [PATCH 05/18] Fix name --- .github/workflows/publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 63fc3638..dd356d9a 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -71,7 +71,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os}} + name: ${{ matrix.os}}.tar path: ${{ runner.temp }}/image.tar retention-days: 1 From 153d9a1a1292d0dabf291855525a6a2270a55695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 17:02:52 +0100 Subject: [PATCH 06/18] change name to pattern --- .github/workflows/publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index dd356d9a..5e986ffb 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -83,7 +83,7 @@ jobs: uses: actions/download-artifact@v4 with: merge-multiple: true - name: "ubuntu-*.tar" + pattern: "ubuntu-*.tar" path: ${{ runner.temp }} - name: Load image (arm) From a27f304f7dd3a7ecf7058811a4fa53e23f4e5076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20S=2E=20Dokken?= Date: Fri, 17 Jan 2025 17:13:36 +0100 Subject: [PATCH 07/18] Minor improvements --- .github/workflows/publish_docker.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 5e986ffb..86843748 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -46,7 +46,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-24.04' }} run: echo "ARCH_TAG=amd64" >> $GITHUB_ENV - - name: Set architecture tag (arm64) + - name: Set architecture tag (arm) if: ${{ contains(matrix.os, 'arm') }} run: echo "ARCH_TAG=arm64" >> $GITHUB_ENV @@ -54,7 +54,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.os }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build Docker image uses: docker/build-push-action@v6 @@ -82,12 +82,11 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: - merge-multiple: true pattern: "ubuntu-*.tar" - path: ${{ runner.temp }} + path: images - name: Load image (arm) run: | - docker load --input ${{ runner.temp }}/ubuntu-24.04-arm.tar - docker load --input ${{ runner.temp }}/ubuntu-24.04.tar + docker load --input images/ubuntu-24.04-arm.tar + docker load --input images/ubuntu-24.04.tar docker image ls -a From 40a3f8880347af2550b8c614f941b71948c4e031 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 13:49:04 +0100 Subject: [PATCH 08/18] Try new strategy --- .github/workflows/publish_docker.yml | 112 +++++++++++++++++++++------ 1 file changed, 89 insertions(+), 23 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 86843748..a1dae1f6 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -1,3 +1,4 @@ +# Recipe based on: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners name: Publish tutorial docker image on: push: @@ -29,8 +30,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -41,6 +42,11 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set architecture tag (amd64) if: ${{ matrix.os == 'ubuntu-24.04' }} @@ -56,37 +62,97 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build Docker image + + - name: Build and push by digest + id: build uses: docker/build-push-action@v6 with: - context: . - load: true - push: false - file: docker/Dockerfile - platforms: linux/${{ env.ARCH_TAG }} - tags: ${{ steps.meta.outputs.tags }} + platforms: ${{ matrix.os }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=docker, dest=${{ runner.temp }}/image.tar + outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" - - name: Upload artifact + - name: Upload digest uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os}}.tar - path: ${{ runner.temp }}/image.tar + name: digests-${{ matrix.os }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error retention-days: 1 - - push: + + merge: runs-on: ubuntu-latest - needs: build + needs: + - build steps: - - name: Download artifacts + - name: Download digests uses: actions/download-artifact@v4 with: - pattern: "ubuntu-*.tar" - path: images + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true - - name: Load image (arm) + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}@sha256:%s ' *) + + - name: Inspect image run: | - docker load --input images/ubuntu-24.04-arm.tar - docker load --input images/ubuntu-24.04.tar - docker image ls -a + docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.version }} + + # - name: Build Docker image + # uses: docker/build-push-action@v6 + # with: + # context: . + # load: true + # push: false + # file: docker/Dockerfile + # platforms: linux/${{ env.ARCH_TAG }} + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # outputs: type=docker, dest=${{ runner.temp }}/image.tar + + # - name: Upload artifact + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ matrix.os}} + # path: ${{ runner.temp }}/image.tar + # retention-days: 1 + + # push: + # runs-on: ubuntu-latest + # needs: build + # steps: + # - name: Download artifacts + # uses: actions/download-artifact@v4 + # with: + # pattern: "ubuntu-*.tar" + # path: images + + # - name: Load image (arm) + # run: | + # ls -l images/ + # # docker load --input images/ubuntu-24.04-arm.tar + # # docker load --input images/ubuntu-24.04.tar + # # docker image ls -a From a78c28cc73f84e601b823cd4a2eb391d3bd98feb Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 13:50:01 +0100 Subject: [PATCH 09/18] Remove duplicate tag --- .github/workflows/publish_docker.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index a1dae1f6..cdb4f8b9 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -56,13 +56,6 @@ jobs: if: ${{ contains(matrix.os, 'arm') }} run: echo "ARCH_TAG=arm64" >> $GITHUB_ENV - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push by digest id: build uses: docker/build-push-action@v6 From ea7af97f6b0d5e9336493bbffdd3ac765a7ff362 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 13:51:33 +0100 Subject: [PATCH 10/18] Revert platform tags --- .github/workflows/publish_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index cdb4f8b9..35f2ebff 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -60,7 +60,7 @@ jobs: id: build uses: docker/build-push-action@v6 with: - platforms: ${{ matrix.os }} + platforms: ${{ env.ARCH_TAG }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true @@ -73,7 +73,7 @@ jobs: - name: Upload digest uses: actions/upload-artifact@v4 with: - name: digests-${{ matrix.os }} + name: digests-${{ env.ARCH_TAG }} path: ${{ runner.temp }}/digests/* if-no-files-found: error retention-days: 1 From e87623845e4ad4d87ee47fd484bb5a031407563b Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 13:55:36 +0100 Subject: [PATCH 11/18] Use correct dockerfile --- .github/workflows/publish_docker.yml | 40 ++-------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 35f2ebff..bda0bc38 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -30,9 +30,6 @@ jobs: - name: Checkout repository 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 @@ -42,6 +39,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 @@ -60,6 +58,7 @@ jobs: id: build uses: docker/build-push-action@v6 with: + file: docker/Dockerfile platforms: ${{ env.ARCH_TAG }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true @@ -114,38 +113,3 @@ jobs: run: | docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ steps.meta.outputs.version }} - # - name: Build Docker image - # uses: docker/build-push-action@v6 - # with: - # context: . - # load: true - # push: false - # file: docker/Dockerfile - # platforms: linux/${{ env.ARCH_TAG }} - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} - # outputs: type=docker, dest=${{ runner.temp }}/image.tar - - # - name: Upload artifact - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ matrix.os}} - # path: ${{ runner.temp }}/image.tar - # retention-days: 1 - - # push: - # runs-on: ubuntu-latest - # needs: build - # steps: - # - name: Download artifacts - # uses: actions/download-artifact@v4 - # with: - # pattern: "ubuntu-*.tar" - # path: images - - # - name: Load image (arm) - # run: | - # ls -l images/ - # # docker load --input images/ubuntu-24.04-arm.tar - # # docker load --input images/ubuntu-24.04.tar - # # docker image ls -a From 4e8791a30e85851e3acdc02ac37b5deaef8b71d8 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 13:58:16 +0100 Subject: [PATCH 12/18] remove first login --- .github/workflows/publish_docker.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index bda0bc38..29500cbb 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -1,5 +1,5 @@ # Recipe based on: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners -name: Publish tutorial docker image +name: Build and publish platform dependent docker image on: push: branches: @@ -33,13 +33,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 @@ -77,7 +70,7 @@ jobs: if-no-files-found: error retention-days: 1 - merge: + merge-and-publish: runs-on: ubuntu-latest needs: - build From 295412f0e0c729e16e1e638f4d7a0a0208322686 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 14:07:08 +0100 Subject: [PATCH 13/18] Add merge skip if not pushing on release or tagging --- .github/workflows/publish_docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 29500cbb..19ce3b6a 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -63,6 +63,7 @@ jobs: touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest + if: github.event_name == 'push' uses: actions/upload-artifact@v4 with: name: digests-${{ env.ARCH_TAG }} @@ -71,6 +72,7 @@ jobs: retention-days: 1 merge-and-publish: + if: github.event_name == 'push' runs-on: ubuntu-latest needs: - build From e3d2d3bd80ad2fb96bcce4ae7761d2ea81778d09 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 16:16:42 +0100 Subject: [PATCH 14/18] Set push to false as we don't need the images before merging. --- .github/workflows/publish_docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 19ce3b6a..bd720ccc 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -54,6 +54,7 @@ jobs: file: docker/Dockerfile platforms: ${{ env.ARCH_TAG }} labels: ${{ steps.meta.outputs.labels }} + push: false outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true - name: Export digest From 3cac7022ec537efc3c0f1f2bfcb1edb96f9331b5 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 16:24:04 +0100 Subject: [PATCH 15/18] Remove push --- .github/workflows/publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index bd720ccc..6c6d9668 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -55,7 +55,7 @@ jobs: platforms: ${{ env.ARCH_TAG }} labels: ${{ steps.meta.outputs.labels }} push: false - outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true + outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true - name: Export digest run: | From 9f02ea5c630d61581a1a05193f10b69f7be89a61 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 16:50:24 +0100 Subject: [PATCH 16/18] Remove conditional to check that simpler code runs --- .github/workflows/publish_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 6c6d9668..3e915d07 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -64,7 +64,7 @@ jobs: touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest - if: github.event_name == 'push' + # if: github.event_name == 'push' uses: actions/upload-artifact@v4 with: name: digests-${{ env.ARCH_TAG }} @@ -73,7 +73,7 @@ jobs: retention-days: 1 merge-and-publish: - if: github.event_name == 'push' + # if: github.event_name == 'push' runs-on: ubuntu-latest needs: - build From 50a276f6557973d67bd7cf130b76d0c09b9dc453 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Sun, 19 Jan 2025 16:57:50 +0100 Subject: [PATCH 17/18] Add back pushtrue --- .github/workflows/publish_docker.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 3e915d07..58fb5d34 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -30,6 +30,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -54,8 +61,7 @@ jobs: file: docker/Dockerfile platforms: ${{ env.ARCH_TAG }} labels: ${{ steps.meta.outputs.labels }} - push: false - outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true + outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}",push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | From 64eaeaeebefb15af3d3b5aab815b7f64cc32a575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Schartum=20Dokken?= Date: Sun, 19 Jan 2025 17:05:28 +0100 Subject: [PATCH 18/18] Revert comment --- .github/workflows/publish_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 58fb5d34..bd09b935 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -70,7 +70,7 @@ jobs: touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest - # if: github.event_name == 'push' + if: github.event_name == 'push' uses: actions/upload-artifact@v4 with: name: digests-${{ env.ARCH_TAG }} @@ -79,7 +79,7 @@ jobs: retention-days: 1 merge-and-publish: - # if: github.event_name == 'push' + if: github.event_name == 'push' runs-on: ubuntu-latest needs: - build