From ade3627804e31326746360d9988fbb9800b319e1 Mon Sep 17 00:00:00 2001 From: sergio Date: Sat, 17 Jan 2026 11:39:51 +0100 Subject: [PATCH] ci matrix strategy update --- .gitea/workflows/ci.yaml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 3b2a268..9f6cae2 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -25,10 +25,15 @@ jobs: echo "Version: 1.0.${{ gitea.run_number }}" >> $GITHUB_STEP_SUMMARY echo "Event: ${{ gitea.event_name }}" >> $GITHUB_STEP_SUMMARY - # CPU image: Multi-arch (amd64 + arm64) + # CPU image: Matrix build for amd64 and arm64 (each pushes as soon as done) build_cpu: runs-on: ubuntu-latest needs: essential + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 steps: - name: Checkout uses: actions/checkout@v4 @@ -46,16 +51,25 @@ jobs: username: username password: ${{ secrets.UNIR_REGISTRY_TOKEN }} - - name: Build and push CPU image (multi-arch) + - name: Get arch suffix + id: arch + run: | + if [ "${{ matrix.platform }}" = "linux/amd64" ]; then + echo "suffix=amd64" >> $GITHUB_OUTPUT + else + echo "suffix=arm64" >> $GITHUB_OUTPUT + fi + + - name: Build and push CPU image (${{ matrix.platform }}) uses: docker/build-push-action@v5 with: context: src/paddle_ocr file: src/paddle_ocr/Dockerfile.cpu - platforms: linux/amd64,linux/arm64 + platforms: ${{ matrix.platform }} push: true tags: | - ${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }} - ${{ needs.essential.outputs.image_cpu }}:latest + ${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }}-${{ steps.arch.outputs.suffix }} + ${{ needs.essential.outputs.image_cpu }}:${{ steps.arch.outputs.suffix }} # GPU image: x86_64 only (PaddlePaddle GPU doesn't support ARM64) build_gpu: