diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 841e481..b788e4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,14 +78,6 @@ jobs: runs-on: ubuntu-latest needs: build if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') - strategy: - matrix: - platform: [amd64, arm64] - include: - - platform: amd64 - arch: amd64 - - platform: arm64 - arch: arm64 steps: - uses: actions/checkout@v4 @@ -101,28 +93,28 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Publish to Docker Hub (${{ matrix.platform }}) + - name: Publish to Docker Hub if: github.ref_name == 'main' uses: docker/build-push-action@v6 with: - platforms: linux/${{ matrix.arch }} + platforms: linux/amd64,linux/arm64 context: . push: true tags: ${{ env.VERSION_TAG }} - cache-from: type=gha,scope=${{ matrix.platform }} + cache-from: type=gha - - name: Publish to Docker Hub latest and stable (${{ matrix.platform }}) + - name: Publish to Docker Hub latest and stable if: startsWith(github.ref, 'refs/tags/v') uses: docker/build-push-action@v6 with: - platforms: linux/${{ matrix.arch }} + platforms: linux/amd64,linux/arm64 context: . push: true tags: | ${{ env.VERSION_TAG }} ${{ env.LATEST_TAG }} ${{ env.STABLE_TAG }} - cache-from: type=gha,scope=${{ matrix.platform }} + cache-from: type=gha # 推送镜像到 GitHub Release publish-release: