From f6ebf20c80cc44aa9345ec5873119f3a6fd066e3 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Sat, 7 Mar 2026 13:19:51 -0800 Subject: [PATCH] background reload secondary --- .gitea/workflows/reload-act-runner.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/reload-act-runner.yaml b/.gitea/workflows/reload-act-runner.yaml index d6074ee..9730b34 100644 --- a/.gitea/workflows/reload-act-runner.yaml +++ b/.gitea/workflows/reload-act-runner.yaml @@ -28,10 +28,24 @@ jobs: stack_name: gitea_act_runner_secondary # the primary runner executes the secondary restart webhook runs_on_label: runner-primary + # 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 - pull-cache-secondary: + wait-for-secondary-death: needs: [diff, reload-secondary] if: ${{ needs.diff.outputs.is_changed == 'true' }} + runs-on: runner-primary + 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 + + pull-cache-secondary: + needs: [diff, wait-for-secondary-death] + if: ${{ needs.diff.outputs.is_changed == 'true' }} + # Because the old secondary is dead, Gitea leaves this job in the queue until the NEW secondary runner boots up. runs-on: runner-secondary steps: - name: Force actions cache pull