diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 729e6cfe..dd75abaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,8 @@ name: Continuous Deployment on: push: branches: [ master ] + workflow_dispatch: + jobs: build-readme-file: @@ -35,7 +37,12 @@ jobs: steps: # Checkout, install tools.. - uses: actions/checkout@v2 - # Use docker to build current directory ./Dockfile + + # 设置Docker BuildX + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # Login to GitHub Container Registry - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: @@ -43,7 +50,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push the Docker image - run: | - docker build . --tag ghcr.io/anduin2017/how-to-cook:latest - docker push ghcr.io/anduin2017/how-to-cook:latest \ No newline at end of file + # 构建并推送多架构Docker镜像 + - name: Build and push multi-arch Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/${{ github.repository }}:latest \ No newline at end of file