From ccc6cff0b14a0b1b9cbc75d2fd0212456062fcb0 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 10:48:05 +0300 Subject: [PATCH 01/18] ci: add new workflow for multiarch --- .github/actions/deploy/action.yaml | 78 ++++++++++++++++++++++++++++ .github/actions/manifest/action.yaml | 72 +++++++++++++++++++++++++ .github/actions/prepare/action.yaml | 43 +++++++++++++++ .github/workflows/build-push.yaml | 76 +++++++++++++-------------- 4 files changed, 229 insertions(+), 40 deletions(-) create mode 100644 .github/actions/deploy/action.yaml create mode 100644 .github/actions/manifest/action.yaml create mode 100644 .github/actions/prepare/action.yaml diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml new file mode 100644 index 0000000..e2a86ef --- /dev/null +++ b/.github/actions/deploy/action.yaml @@ -0,0 +1,78 @@ +name: Deploy +description: Build and push a docker image to Docker Hub + +outputs: + tag: + description: "Tags for the docker image" + value: ${{ steps.meta.outputs.tags[0] }} + +inputs: + platform: + description: The platform to build for + type: string + required: true + build_args: + description: Build arguments to pass to the Docker build + default: "" + type: string + required: false + tag: + description: Docker hub tag to push to + type: string + required: true + # Secrets + DOCKER_USERNAME: + required: true + DOCKER_PASSWORD: + required: true + MACOS_PASSWORD: + required: true + +runs: + using: composite + steps: + - name: Checkout this repo + uses: actions/checkout@v4 + - name: Set up Docker Context for Buildx + shell: bash + id: buildx-context + run: | + docker context use builders || docker context create builders + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + - name: Unlock MacOS keychain for Docker Hub login + shell: bash + if: runner.os == 'macOS' + run: | + security -v unlock-keychain -p ${{ inputs.MACOS_PASSWORD }} ~/Library/Keychains/login.keychain-db + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ inputs.DOCKER_USERNAME }} + password: ${{ inputs.DOCKER_PASSWORD }} + - name: Generate slug + id: slzug + shell: bash + run: | + echo "slug=$(echo "$platform" | tr '/' '-') + - name: Docker build & push + id: docker_build + uses: docker/build-push-action@v5 + with: + context: '.' + file: Dockerfile + tags: ${{ steps.meta.outputs.tags[0] }}-${{ steps.vars.outputs.slug }} + push: true + platforms: ${{ inputs.platform }} + build-args: ${{ inputs.build_args }} + - name: Image digest & tags + shell: bash + if: ${{ inputs.build_script == '' }} + run: | + cat << EOF + digest: ${{ steps.docker_build.outputs.digest }} + tags: + ${{ steps.meta.outputs.tags[0] }} + EOF diff --git a/.github/actions/manifest/action.yaml b/.github/actions/manifest/action.yaml new file mode 100644 index 0000000..c039916 --- /dev/null +++ b/.github/actions/manifest/action.yaml @@ -0,0 +1,72 @@ +name: Manifest +description: Build and push a docker manifest to Docker Hub + +inputs: + platforms: + # eg [{"platform":"linux/amd64", "runner": "ARM64", "slug": "something-arm64"},{"platform":"linux/arm64", "runner": "ubuntu-latest", "slug": "something-amd64"}] + description: JSON list of platforms to build for + type: string + required: true + tag: + description: Docker hub tag to push to + type: string + required: true + repository: + description: Docker hub repository to push to + type: string + required: true + DOCKER_USERNAME: + required: true + DOCKER_PASSWORD: + required: true + +runs: + using: composite + steps: + - name: Checkout this repo + uses: actions/checkout@v4 + - name: Generate images list + id: generate_images_list + shell: bash + run: | + PLATFORMS='${{ inputs.platforms }}' + + # Iterate over the platforms and build the image list + len=$(echo $PLATFORMS | jq '. | length') + for ((i=0; i<$len; i++)); do + slug=$(echo $PLATFORMS | jq -r --argjson i $i '.[$i].slug') + imagetag="${{ inputs.tag }}-$slug" + image="${{ inputs.repository }}:$imagetag" + url="https://hub.docker.com/v2/repositories/${{ inputs.repository }}/tags?page_size=25&page=1&ordering=&name=$imagetag" + exists=$(curl -s $url | jq '.results | length > 0') + if [ "$exists" == "true" ]; then + IMAGES+="${{ inputs.repository }}:${{ inputs.tag }}-$slug " + fi + done + + IMAGES=${IMAGES::-1} # Remove the trailing space + echo "IMAGES: $IMAGES" + echo "images=$IMAGES" >> $GITHUB_OUTPUT + - name: Check if there is atleast one image + if: ${{ steps.generate_images_list.outputs.images == '[]' || steps.generate_images_list.outputs.images == '' }} + shell: bash + run: exit 1 + - name: Set up Docker Context for Buildx + shell: bash + id: buildx-context + run: | + docker context create builders + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ inputs.DOCKER_USERNAME }} + password: ${{ inputs.DOCKER_PASSWORD }} + - name: Create and push manifest images + shell: bash + run: | + docker buildx imagetools create --dry-run -t ${{ inputs.repository }}:${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} + docker buildx imagetools create -t ${{ inputs.repository }}:${{ inputs.tag }} -t ${{ inputs.repository }}:${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml new file mode 100644 index 0000000..c170864 --- /dev/null +++ b/.github/actions/prepare/action.yaml @@ -0,0 +1,43 @@ +name: 'Setup' +description: 'Read and parse config files for builds' +outputs: + platforms: + description: "Matrix of platforms and runner to use" + value: ${{ steps.setup_platforms.outputs.platforms }} + tag: + description: "Tags for the docker image" + value: ${{ steps.meta.outputs.tags[0] }} +runs: + using: "composite" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: mikefarah/yq@v4.35.1 + - name: Generate platform and runner matrix from config files + id: setup_platforms + shell: bash + run: | + PLATFORMS_JSON="[" + + # Extract the platforms + platforms=$(yq e ".ethereum-genesis-generator[]" platforms.yaml) + + for platform in $platforms; do + slug=$(echo "$platform" | tr '/' '-') + runner=$(yq e ".\"$platform\"" runners.yaml) + PLATFORMS_JSON+="{\"platform\":\"$platform\", \"runner\":\"$runner\", \"slug\":\"$slug\"}," + done + + PLATFORMS_JSON="${PLATFORMS_JSON%,}]" + echo "platforms=$PLATFORMS_JSON" >> $GITHUB_OUTPUT + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ethpandaops/ethereum-genesis-generator + flavor: latest=true + tags: | + type=semver,pattern=verkle-gen-{{version}} + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index 6e64704..533d2f2 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -3,52 +3,48 @@ on: push: branches: - master + - multiarch-build tags: - '**' workflow_dispatch: jobs: - build-push: - name: build-push + prepare: runs-on: ubuntu-latest + outputs: + platforms: ${{ steps.setup.outputs.platforms }} steps: - - name: Checkout this repo - uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Context for Buildx - shell: bash - id: buildx-context - run: | - docker context create builders - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - endpoint: builders - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ethpandaops/ethereum-genesis-generator - flavor: latest=true - tags: | - type=semver,pattern=verkle-gen-{{version}} - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v2 + - uses: actions/checkout@v4 + - name: Prepare Matrix + id: setup + uses: ./.github/actions/prepare + deploy: + needs: + - prepare + runs-on: ${{ matrix.runner }} + continue-on-error: true + strategy: + matrix: + include: ${{fromJson(needs.prepare.outputs.platforms)}} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/deploy with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: docker-build-push - id: docker_build - uses: docker/build-push-action@v4 + platform: ${{ matrix.platform }} + tag: ethpandaops/ethereum-genesis-generator:${{ needs.prepare.outputs.tag }} + DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" + manifest: + needs: + - prepare + - deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/manifest with: - context: . - file: Dockerfile - tags: ${{ steps.meta.outputs.tags }} - push: true - platforms: linux/amd64,linux/arm64 - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file + tag: ${{ needs.prepare.outputs.tag }} + repository: ethpandaops/ethereum-genesis-generator + platforms: ${{ needs.prepare.outputs.platforms }} + DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" From 1909de2e7a10695a56ba54d57b30c1729001f1f6 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 10:48:54 +0300 Subject: [PATCH 02/18] ci: add platforms file --- platforms.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 platforms.yaml diff --git a/platforms.yaml b/platforms.yaml new file mode 100644 index 0000000..ae2d4b1 --- /dev/null +++ b/platforms.yaml @@ -0,0 +1,3 @@ +ethereum-genesis-generator: + - linux/amd64 + - linux/arm64 From 0c2f675e90e904cb45f3175ce39f2a48f310a27e Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 10:50:48 +0300 Subject: [PATCH 03/18] ci: add docker creds --- .github/workflows/build-push.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index 533d2f2..b4e68d9 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -18,6 +18,9 @@ jobs: - name: Prepare Matrix id: setup uses: ./.github/actions/prepare + with: + DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" deploy: needs: - prepare From 568f2c7951d9a0d19127c40cf1c05ede74730a02 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 10:53:46 +0300 Subject: [PATCH 04/18] ci: fixup docker secret ref --- .github/workflows/build-push.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index b4e68d9..8a0adb1 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -18,9 +18,6 @@ jobs: - name: Prepare Matrix id: setup uses: ./.github/actions/prepare - with: - DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" - DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" deploy: needs: - prepare @@ -35,7 +32,7 @@ jobs: with: platform: ${{ matrix.platform }} tag: ethpandaops/ethereum-genesis-generator:${{ needs.prepare.outputs.tag }} - DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" manifest: needs: @@ -49,5 +46,5 @@ jobs: tag: ${{ needs.prepare.outputs.tag }} repository: ethpandaops/ethereum-genesis-generator platforms: ${{ needs.prepare.outputs.platforms }} - DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}" + DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" From 4fdbc0d0e85a1e024497687bd265cdd22d3b93e4 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:01:50 +0300 Subject: [PATCH 05/18] ci: fixup slug --- .github/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml index e2a86ef..2da1ce4 100644 --- a/.github/actions/deploy/action.yaml +++ b/.github/actions/deploy/action.yaml @@ -56,7 +56,7 @@ runs: id: slzug shell: bash run: | - echo "slug=$(echo "$platform" | tr '/' '-') + echo "slug=$(echo "${{ inputs.platform }}" | tr '/' '-') - name: Docker build & push id: docker_build uses: docker/build-push-action@v5 From 9bf832c6d518a95c495df8e4a3764303bd69813a Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:04:06 +0300 Subject: [PATCH 06/18] ci: missing quote --- .github/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml index 2da1ce4..ca8e1c0 100644 --- a/.github/actions/deploy/action.yaml +++ b/.github/actions/deploy/action.yaml @@ -56,7 +56,7 @@ runs: id: slzug shell: bash run: | - echo "slug=$(echo "${{ inputs.platform }}" | tr '/' '-') + echo "slug=$(echo '${{ inputs.platform }}' | tr '/' '-')" - name: Docker build & push id: docker_build uses: docker/build-push-action@v5 From dbc70fd23c7f2bd67a4271fddf44f7e6e0de2c59 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:07:28 +0300 Subject: [PATCH 07/18] ci: fixup tags in deploy action --- .github/actions/deploy/action.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml index ca8e1c0..91b36ce 100644 --- a/.github/actions/deploy/action.yaml +++ b/.github/actions/deploy/action.yaml @@ -63,16 +63,15 @@ runs: with: context: '.' file: Dockerfile - tags: ${{ steps.meta.outputs.tags[0] }}-${{ steps.vars.outputs.slug }} + tags: ${{ inputs.tag }}-${{ steps.vars.outputs.slug }} push: true platforms: ${{ inputs.platform }} build-args: ${{ inputs.build_args }} - name: Image digest & tags shell: bash - if: ${{ inputs.build_script == '' }} run: | cat << EOF digest: ${{ steps.docker_build.outputs.digest }} tags: - ${{ steps.meta.outputs.tags[0] }} + ${{ inputs.tag }}-${{ steps.vars.outputs.slug }} EOF From 4b5a477973f361346dad4e0063fe08a751618310 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:12:31 +0300 Subject: [PATCH 08/18] ci: fixup tag output --- .github/workflows/build-push.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index 8a0adb1..a336487 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest outputs: platforms: ${{ steps.setup.outputs.platforms }} + tag: ${{ steps.setup.outputs.tag }} steps: - uses: actions/checkout@v4 - name: Prepare Matrix From 14749a6209404e7be1f1ac0910b032311d957cfb Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:20:31 +0300 Subject: [PATCH 09/18] ci: try parse meta json output --- .github/actions/prepare/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml index c170864..46cc336 100644 --- a/.github/actions/prepare/action.yaml +++ b/.github/actions/prepare/action.yaml @@ -6,7 +6,7 @@ outputs: value: ${{ steps.setup_platforms.outputs.platforms }} tag: description: "Tags for the docker image" - value: ${{ steps.meta.outputs.tags[0] }} + value: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} runs: using: "composite" steps: @@ -32,7 +32,7 @@ runs: echo "platforms=$PLATFORMS_JSON" >> $GITHUB_OUTPUT - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ethpandaops/ethereum-genesis-generator flavor: latest=true From 282143a0d20c7f597fc7f722863640ff8c5ed05e Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:25:06 +0300 Subject: [PATCH 10/18] ci: debug --- .github/actions/prepare/action.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml index 46cc336..5c7614a 100644 --- a/.github/actions/prepare/action.yaml +++ b/.github/actions/prepare/action.yaml @@ -41,3 +41,10 @@ runs: type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} + - name: debug + id: debug + shell: bash + run: | + echo "${{ steps.meta.outputs.tags }}" + echo "${{ steps.meta.outputs.tags[0] }}" + echo "${{ fromJSON(steps.meta.outputs.json).tags[0] }}" From 14e7db3c9fbdc32eab92b660bd8f1fc185712b93 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:29:56 +0300 Subject: [PATCH 11/18] ci: try fixup tag output --- .github/actions/prepare/action.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/actions/prepare/action.yaml b/.github/actions/prepare/action.yaml index 5c7614a..760811d 100644 --- a/.github/actions/prepare/action.yaml +++ b/.github/actions/prepare/action.yaml @@ -5,8 +5,8 @@ outputs: description: "Matrix of platforms and runner to use" value: ${{ steps.setup_platforms.outputs.platforms }} tag: - description: "Tags for the docker image" - value: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} + description: "Tag for the docker image" + value: ${{ steps.set_tag.outputs.tag }} runs: using: "composite" steps: @@ -41,10 +41,8 @@ runs: type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} - - name: debug - id: debug + - name: Set tag + id: set_tag shell: bash run: | - echo "${{ steps.meta.outputs.tags }}" - echo "${{ steps.meta.outputs.tags[0] }}" - echo "${{ fromJSON(steps.meta.outputs.json).tags[0] }}" + echo "tag=${{ fromJSON(steps.meta.outputs.json).tags[0] }}" >> $GITHUB_OUTPUT From 4a7ad8b0ef5bbcfc07e75a6bf1f038c60dd2363c Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 11:49:08 +0300 Subject: [PATCH 12/18] ci: try fixup tag output from step --- .github/actions/deploy/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml index 91b36ce..7f3925b 100644 --- a/.github/actions/deploy/action.yaml +++ b/.github/actions/deploy/action.yaml @@ -53,10 +53,10 @@ runs: username: ${{ inputs.DOCKER_USERNAME }} password: ${{ inputs.DOCKER_PASSWORD }} - name: Generate slug - id: slzug + id: vars shell: bash run: | - echo "slug=$(echo '${{ inputs.platform }}' | tr '/' '-')" + echo "slug=$(echo '${{ inputs.platform }}' | tr '/' '-')" >> $GITHUB_OUTPUT - name: Docker build & push id: docker_build uses: docker/build-push-action@v5 From d36cd03b19969a7895e40e862fcefa60b60246e5 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:00:57 +0300 Subject: [PATCH 13/18] ci: pass tag only --- .github/workflows/build-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index a336487..9ef30e8 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -32,7 +32,7 @@ jobs: - uses: ./.github/actions/deploy with: platform: ${{ matrix.platform }} - tag: ethpandaops/ethereum-genesis-generator:${{ needs.prepare.outputs.tag }} + tag: ${{ needs.prepare.outputs.tag }} DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" manifest: From 54e5b6394ab5382d763acc4cae618d4a488cafaa Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:05:28 +0300 Subject: [PATCH 14/18] ci: debug --- .github/actions/deploy/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/deploy/action.yaml b/.github/actions/deploy/action.yaml index 7f3925b..ecc8df5 100644 --- a/.github/actions/deploy/action.yaml +++ b/.github/actions/deploy/action.yaml @@ -57,6 +57,8 @@ runs: shell: bash run: | echo "slug=$(echo '${{ inputs.platform }}' | tr '/' '-')" >> $GITHUB_OUTPUT + echo "DEBUG" + echo "${{ inputs.tag }}" - name: Docker build & push id: docker_build uses: docker/build-push-action@v5 From 923fa463ac5c1c2b938ad828230403a6868bb687 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:22:11 +0300 Subject: [PATCH 15/18] ci: fixup tag on manifest generation --- .github/actions/manifest/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/manifest/action.yaml b/.github/actions/manifest/action.yaml index c039916..00f03c1 100644 --- a/.github/actions/manifest/action.yaml +++ b/.github/actions/manifest/action.yaml @@ -36,6 +36,7 @@ runs: for ((i=0; i<$len; i++)); do slug=$(echo $PLATFORMS | jq -r --argjson i $i '.[$i].slug') imagetag="${{ inputs.tag }}-$slug" + imagetag=$(echo $imagetag | cut -d ':' -f2) image="${{ inputs.repository }}:$imagetag" url="https://hub.docker.com/v2/repositories/${{ inputs.repository }}/tags?page_size=25&page=1&ordering=&name=$imagetag" exists=$(curl -s $url | jq '.results | length > 0') From 894fdcc1d6f446fea7a25ee7566985efa0c7e2bd Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:30:41 +0300 Subject: [PATCH 16/18] ci: try fixup manifest tags --- .github/actions/manifest/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/manifest/action.yaml b/.github/actions/manifest/action.yaml index 00f03c1..1985951 100644 --- a/.github/actions/manifest/action.yaml +++ b/.github/actions/manifest/action.yaml @@ -69,5 +69,5 @@ runs: - name: Create and push manifest images shell: bash run: | - docker buildx imagetools create --dry-run -t ${{ inputs.repository }}:${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} - docker buildx imagetools create -t ${{ inputs.repository }}:${{ inputs.tag }} -t ${{ inputs.repository }}:${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} + docker buildx imagetools create --dry-run -t ${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} + docker buildx imagetools create -t ${{ inputs.tag }} ${{ steps.generate_images_list.outputs.images }} From 17cae9c9662ded6dd8403056ef702350db85266d Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:34:51 +0300 Subject: [PATCH 17/18] ci: fixup images names --- .github/actions/manifest/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/manifest/action.yaml b/.github/actions/manifest/action.yaml index 1985951..31a67aa 100644 --- a/.github/actions/manifest/action.yaml +++ b/.github/actions/manifest/action.yaml @@ -41,7 +41,7 @@ runs: url="https://hub.docker.com/v2/repositories/${{ inputs.repository }}/tags?page_size=25&page=1&ordering=&name=$imagetag" exists=$(curl -s $url | jq '.results | length > 0') if [ "$exists" == "true" ]; then - IMAGES+="${{ inputs.repository }}:${{ inputs.tag }}-$slug " + IMAGES+="${{ inputs.tag }}-$slug " fi done From b1767eb272a7424f637cc15ef646622eaa88f590 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 15 May 2024 12:38:59 +0300 Subject: [PATCH 18/18] ci: correct branches --- .github/workflows/build-push.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index 9ef30e8..b04d5cc 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -3,7 +3,6 @@ on: push: branches: - master - - multiarch-build tags: - '**' workflow_dispatch: