From 700f2ccf83f03ca454b7b8dbcf03b508c6eacdc3 Mon Sep 17 00:00:00 2001 From: kunish Date: Tue, 13 Jun 2023 14:08:56 +0800 Subject: [PATCH] ci: docker multi-platform using matrix --- .github/workflows/publish-docker-image.yml | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index 403190e2..8d80a612 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -2,26 +2,41 @@ name: Publish Docker Image on: push: - release: - types: [prereleased] + # release: + # types: [prereleased] jobs: publish-docker-image: runs-on: ubuntu-latest - if: github.event_name == 'release' + # if: github.event_name == 'release' + steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - - name: docker image - quay.io - uses: aevea/action-kaniko@master + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to quay.io + uses: docker/login-action@v2 with: registry: quay.io username: ${{ github.repository_owner }} password: ${{ secrets.QUAY_PASS }} - image: ${{ github.repository }} - build_file: Dockerfile - tag_with_latest: true - cache: true - cache_registry: quay.io/${{ github.repository_owner }}/cache + + - name: Build quay.io image + uses: docker/build-push-action@v4 + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + file: Dockerfile + platforms: linux/arm/v6,linux/arm/v7,linux/arm64,linux/amd64,linux/386 + push: true + tags: | + quay.io/${{ github.repository }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max