From 7475a30fe9fdd209d95abed21300f530954f624f Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 16 Apr 2025 22:50:31 +0800 Subject: [PATCH] chore: update docker platforms --- .../workflows/build-and-push-canary-image.yml | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-push-canary-image.yml b/.github/workflows/build-and-push-canary-image.yml index 2ecec816d..1070f8501 100644 --- a/.github/workflows/build-and-push-canary-image.yml +++ b/.github/workflows/build-and-push-canary-image.yml @@ -4,6 +4,12 @@ on: push: branches: [main] +env: + DOCKER_PLATFORMS: | + linux/amd64 + linux/arm/v7 + linux/arm64 + jobs: build-and-push-canary-image: runs-on: ubuntu-latest @@ -15,26 +21,16 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} + platforms: ${{ env.DOCKER_PLATFORMS }} - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 with: + version: latest install: true - version: v0.9.1 + platforms: ${{ env.DOCKER_PLATFORMS }} - name: Docker meta id: meta @@ -48,13 +44,26 @@ jobs: tags: | type=raw,value=canary + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - name: Build and Push id: docker_build uses: docker/build-push-action@v6 with: context: . file: ./scripts/Dockerfile - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + platforms: ${{ env.DOCKER_PLATFORMS }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}