From 297f973a15374cd3f8271ba6160f7c717bfd0fbb Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 27 Dec 2025 08:22:21 +0100 Subject: [PATCH] Implement retry logic for add-on build process Added a retry mechanism for building the add-on in case of failure, with a wait time of 3 minutes before the second attempt. --- .github/workflows/onpush_builder.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/onpush_builder.yaml b/.github/workflows/onpush_builder.yaml index bfe6d3bae..edad7a90f 100644 --- a/.github/workflows/onpush_builder.yaml +++ b/.github/workflows/onpush_builder.yaml @@ -170,9 +170,28 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build ${{ matrix.addon }} add-on - id: builderstep + - name: Build ${{ matrix.addon }} add-on (attempt 1) + id: builderstep1 if: steps.check.outputs.build_arch == 'true' && steps.dockerfile_check.outputs.has_dockerfile == 'true' + continue-on-error: true + uses: home-assistant/builder@2025.11.0 + env: + CAS_API_KEY: ${{ secrets.CAS_API_KEY }} + with: + args: | + ${{ env.BUILD_ARGS }} \ + --${{ matrix.arch }} \ + --target "/data/${{ matrix.addon }}" \ + --image "${{ steps.check.outputs.image }}" \ + --docker-hub "ghcr.io/${{ github.repository_owner }}" \ + --addon + + - name: Wait 3 minutes before retry + if: steps.check.outputs.build_arch == 'true' && steps.dockerfile_check.outputs.has_dockerfile == 'true' && steps.builderstep1.outcome == 'failure' + run: sleep 180 + + - name: Build ${{ matrix.addon }} add-on (attempt 2) + if: steps.check.outputs.build_arch == 'true' && steps.dockerfile_check.outputs.has_dockerfile == 'true' && steps.builderstep1.outcome == 'failure' uses: home-assistant/builder@2025.11.0 env: CAS_API_KEY: ${{ secrets.CAS_API_KEY }}