From b8e28afa401432ad957849e49b86938ee0f48d18 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Sun, 8 Mar 2026 20:34:18 -0700 Subject: [PATCH] add wait for primary death --- .gitea/workflows/reload-act-runner.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/reload-act-runner.yaml b/.gitea/workflows/reload-act-runner.yaml index 8b2f7cc..4c06c32 100644 --- a/.gitea/workflows/reload-act-runner.yaml +++ b/.gitea/workflows/reload-act-runner.yaml @@ -18,9 +18,22 @@ jobs: stack_name: gitea_act_runner # the secondary runner executes the primary restart webhook runs_on_label: runner-secondary + # We use a detached webhook call so primary doesn't hang if the Gitainer stack takes 5 minutes to rebuild, and it avoids bridge network drop edge cases + delayed_silent: true + + wait-for-primary-death: + needs: [diff, reload-primary] + if: ${{ needs.diff.outputs.is_changed == 'true' }} + runs-on: runner-secondary + steps: + - name: Wait for Gitainer to kill the secondary runner + run: | + echo "The detached webhook container sleeps for 10s before firing." + echo "We wait 30s here to guarantee the webhook fired and Gitainer destroyed the old secondary runner." + sleep 30 reload-secondary: - needs: [diff, reload-primary] + needs: [diff, wait-for-primary-death] if: ${{ needs.diff.outputs.is_changed == 'true' }} # ensuring the primary actually survived and restarted successfully uses: https://gitea.chromart.cc/martin/chromart-gitea-actions/.gitea/workflows/gitainer-deploy.yaml@main