Screenly / Anthias

The world's most popular open source digital signage project.
https://anthias.screenly.io
Other
2.53k stars 622 forks source link

Fix issue with the retry hook isn't triggered #1756

Open vpetersson opened 1 year ago

vpetersson commented 1 year ago

We currently have this structure in our build_docker.yaml:

      - uses: balena-io/deploy-to-balena-action@master
        id: build
        continue-on-error: true
        with:
          balena_token: ${{ secrets.BALENA_TOKEN }}
          fleet: screenly_ose/anthias-${{ matrix.board }}
          source: balena-deploy

      - name: Sleep random sleep before retry
        if: ${{ failure() && steps.build.conclusion == 'failure' }}
        run: |
          sleep $((120 + RANDOM % 900));
      # Balena deploy often fails with 'ESOCKETTIMEDOUT'.
      # This adds some retry logic.
      - uses: balena-io/deploy-to-balena-action@master
        id: build-retry
        if: ${{ failure() && steps.build.conclusion == 'failure' }}
        with:
          balena_token: ${{ secrets.BALENA_TOKEN }}
          fleet: screenly_ose/anthias-${{ matrix.board }}
          source: balena-deploy

In theory, this should trigger a retry if the balena deploy However, for whatever reason, it doesn't:

Screenshot 2023-02-27 at 8 08 27 AM
ealmonte32 commented 1 year ago

I dont know much about these yaml workflows, but wouldn't the continue-on-error pass on a exit code value not equal to 0, meaning the failure() has no "failure" code as the return value thus maybe that is why it isn't triggering? 😕