From 574038430925e67e8110ce8e059afeaba1907e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Wed, 14 Jan 2026 07:29:41 +0800 Subject: [PATCH] docker build --- .github/workflows/build-base-image.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-base-image.yml b/.github/workflows/build-base-image.yml index ceffe5e..e7ccb56 100644 --- a/.github/workflows/build-base-image.yml +++ b/.github/workflows/build-base-image.yml @@ -14,9 +14,14 @@ permissions: contents: read jobs: + # 定义构建镜像的通用模板 build-image: runs-on: ubuntu-latest if: github.event_name != 'pull_request' + strategy: + fail-fast: false # 一个构建失败不影响另一个 + matrix: + image-type: [runtime, builder] # 并行构建两种镜像 steps: - uses: actions/checkout@v4 with: @@ -31,22 +36,11 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push runtime + - name: Build and push ${{ matrix.image-type }} uses: docker/build-push-action@v4 with: context: . - file: ./Dockerfile.runtime + file: ./Dockerfile.${{ matrix.image-type }} platforms: linux/amd64, linux/arm64, linux/arm/v7 push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:runtime - - - name: Build and push builder - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.builder - platforms: linux/amd64, linux/arm64, linux/arm/v7 - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:builder - + tags: ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:${{ matrix.image-type }}