From cd2afff392e84d7b7fb247318d4e14f61705bdec Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 7 Oct 2024 12:27:59 +0100 Subject: [PATCH] feat(ci): run on real arm64 builders Emulated arm64 builds are slow. Fortunately, GitHub has real Linux ARM64 hardware these days, so let's switch to it. --- .github/workflows/docker.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 502207f48..71fe532bc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,13 +29,14 @@ env: jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: platform: - - linux/amd64 - - linux/arm64 + - ubuntu-latest + - github-hosted-ubuntu-arm64 + + runs-on: ${{ matrix.platform }} steps: - name: Checkout @@ -54,7 +55,7 @@ jobs: uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - name: Login to DockerHub - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: grafana/shared-workflows/actions/dockerhub-login@main - name: Build and push by digest @@ -62,13 +63,12 @@ jobs: uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 with: context: . - platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name == 'push' }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} - name: Export digest id: digest - if: github.event_name == 'push' + if: github.event_name != 'pull_request' run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" @@ -76,7 +76,7 @@ jobs: echo "artifact_name=digests-${{ matrix.platform }}" | sed -e 's/\//-/g' >> "$GITHUB_OUTPUT" - name: Upload digest - if: github.event_name == 'push' + if: github.event_name != 'pull_request' uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: ${{ steps.digest.outputs.artifact_name }} @@ -86,20 +86,20 @@ jobs: merge: runs-on: ubuntu-latest - if: github.event_name == 'push' + if: github.event_name != 'pull_request' needs: - build steps: - name: Download digests (linux/amd64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: digests-linux-amd64 + name: digests-github-hosted-ubuntu-arm64 path: /tmp/digests-linux-amd64 - name: Download digests (linux/arm64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: digests-linux-arm64 + name: digests-ubuntu-latest path: /tmp/digests-linux-arm64 - name: Merge digests