From c4d21a7487e6f85b7585218a74caeff92124881f Mon Sep 17 00:00:00 2001 From: kiss2u Date: Tue, 5 Nov 2024 14:20:12 +0800 Subject: [PATCH] Update docker-multiarch.yml --- .github/workflows/docker-multiarch.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-multiarch.yml b/.github/workflows/docker-multiarch.yml index 9ba04b6..3bbb3ef 100644 --- a/.github/workflows/docker-multiarch.yml +++ b/.github/workflows/docker-multiarch.yml @@ -1,9 +1,9 @@ -name: Build and Push Multi-Arch Docker Image +name: Build and Push Docker Image on: push: branches: - - main # 或者你使用的其他分支 + - main pull_request: branches: - main @@ -11,16 +11,13 @@ on: jobs: build-and-push: runs-on: ubuntu-latest + strategy: + matrix: + platform: [linux/amd64, linux/arm64] steps: - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: actions/checkout@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -28,11 +25,17 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push Docker image uses: docker/build-push-action@v3 with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - push: true + platforms: ${{ matrix.platform }} tags: ${{ secrets.DOCKER_USERNAME }}/bilibili-audio-downloader:latest + push: true