From 99c12d2d3c114c76d8b0dd5da72cd1399b714fde Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Thu, 16 Apr 2026 09:18:35 +0200 Subject: [PATCH] Use ARM64 runners for 18.x --- .github/workflows/image-release.yml | 104 +++++++++++++++++++++++++--- .github/workflows/release.yml | 15 +--- 2 files changed, 96 insertions(+), 23 deletions(-) diff --git a/.github/workflows/image-release.yml b/.github/workflows/image-release.yml index 6a8965f..74b0e5b 100644 --- a/.github/workflows/image-release.yml +++ b/.github/workflows/image-release.yml @@ -12,9 +12,6 @@ on: dockerfile: required: true type: string - platforms: - required: true - type: string is-latest: required: false type: boolean @@ -39,11 +36,23 @@ on: jobs: release: - runs-on: [self-hosted, ARM64, stable] + runs-on: ${{ matrix.builder }} + strategy: + matrix: + include: + - builder: ubuntu-latest + platform: linux/amd64 + - builder: ubuntu-24.04-arm + platform: linux/arm64 environment: DOCKER_HUB steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 + + - name: Prepare artifact key + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Docker meta id: meta @@ -65,9 +74,6 @@ jobs: type=raw,value=latest,enable=${{ inputs.is-latest }} type=raw,value=${{ inputs.volto-version }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -78,13 +84,91 @@ jobs: password: ${{ secrets.registry-password }} - name: Build and push + id: build uses: docker/build-push-action@v6 with: - platforms: ${{ inputs.platforms }} + platforms: ${{ matrix.platform }} context: ${{ inputs.context }} file: ${{ inputs.dockerfile }} build-args: | VOLTO_VERSION=${{ inputs.volto-version }} + SUFFIX=${{ inputs.suffix }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ inputs.image-name }} labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,push-by-digest=true,name-canonical=true,push=true,name=${{ inputs.image-name }} + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: List digest directory + working-directory: ${{ runner.temp }}/digests + run: ls -la + + - name: Upload digest + uses: actions/upload-artifact@v5 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + overwrite: true + retention-days: 1 + + merge: + runs-on: ubuntu-latest + environment: DOCKER_HUB + needs: + - release + steps: + - name: Download digests + uses: actions/download-artifact@v5 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: List digest directory + working-directory: ${{ runner.temp }}/digests + run: ls -la + + - name: Login to Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.registry-username }} + password: ${{ secrets.registry-password }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ inputs.image-name }} + flavor: | + latest=false + suffix=${{ inputs.suffix }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=pep440,pattern={{version}},value=${{ inputs.volto-version }} + type=pep440,pattern={{major}}.{{minor}}.{{patch}},value=${{ inputs.volto-version }} + type=pep440,pattern={{major}}.{{minor}},value=${{ inputs.volto-version }} + type=pep440,pattern={{major}},value=${{ inputs.volto-version }} + type=sha + type=raw,value=latest,enable=${{ inputs.is-latest }} + type=raw,value=${{ inputs.volto-version }} + + - 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 '${{ inputs.image-name }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ inputs.image-name }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccb3fbc..ba6f408 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,6 @@ on: env: BASE_IMAGE_NAME: plone/frontend - PLATFORMS: linux/amd64,linux/arm64 IS_LATEST: true jobs: @@ -17,18 +16,16 @@ jobs: outputs: BASE_IMAGE_NAME: ${{ steps.vars.outputs.BASE_IMAGE_NAME }} IS_LATEST: ${{ steps.vars.outputs.IS_LATEST }} - PLATFORMS: ${{ steps.vars.outputs.PLATFORMS }} VOLTO_VERSION: ${{ steps.vars.outputs.VOLTO_VERSION }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Set BASE_IMAGE_NAME, IS_LATEST, PLATFORMS, VOLTO_VERSION + - name: Set BASE_IMAGE_NAME, IS_LATEST, VOLTO_VERSION id: vars run: | echo "BASE_IMAGE_NAME=$BASE_IMAGE_NAME" >> $GITHUB_OUTPUT - echo "PLATFORMS=$PLATFORMS" >> $GITHUB_OUTPUT echo "IS_LATEST=$IS_LATEST" >> $GITHUB_OUTPUT echo "VOLTO_VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT @@ -41,7 +38,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-builder context: ./pnpm dockerfile: pnpm/Dockerfile.builder - platforms: ${{ needs.meta.outputs.PLATFORMS }} is-latest: ${{ needs.meta.outputs.IS_LATEST == 'true' }} secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -54,7 +50,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-prod-config context: ./pnpm dockerfile: pnpm/Dockerfile.prod - platforms: ${{ needs.meta.outputs.PLATFORMS }} is-latest: ${{ needs.meta.outputs.IS_LATEST == 'true' }} secrets: @@ -70,7 +65,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-dev context: ./pnpm dockerfile: pnpm/Dockerfile.dev - platforms: ${{ needs.meta.outputs.PLATFORMS }} is-latest: ${{ needs.meta.outputs.IS_LATEST == 'true' }} secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -86,7 +80,6 @@ jobs: image-name: plone/plone-frontend context: ./pnpm dockerfile: pnpm/Dockerfile - platforms: ${{ needs.meta.outputs.PLATFORMS }} is-latest: ${{ needs.meta.outputs.IS_LATEST == 'true' }} secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -105,7 +98,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-builder context: ./yarn dockerfile: yarn/Dockerfile.builder - platforms: ${{ needs.meta.outputs.PLATFORMS }} suffix: -yarn secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -118,7 +110,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-prod-config context: ./yarn dockerfile: yarn/Dockerfile.prod - platforms: ${{ needs.meta.outputs.PLATFORMS }} suffix: -yarn secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -133,7 +124,6 @@ jobs: image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-dev context: ./yarn dockerfile: yarn/Dockerfile.dev - platforms: ${{ needs.meta.outputs.PLATFORMS }} suffix: -yarn secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -149,7 +139,6 @@ jobs: image-name: plone/plone-frontend context: ./yarn dockerfile: yarn/Dockerfile - platforms: ${{ needs.meta.outputs.PLATFORMS }} suffix: -yarn secrets: registry-username: ${{ secrets.DOCKERHUB_USERNAME }}