chromart-gitea-actions/.gitea/workflows/reload-act-runner.yaml
Martin Dimitrov f9ff69f786
Some checks failed
Reload Act Runner Stack to clear cache for workflows / diff (push) Successful in 32s
Reload Act Runner Stack to clear cache for workflows / reload-primary (push) Successful in 7s
Reload Act Runner Stack to clear cache for workflows / reload-secondary (push) Successful in 2s
Reload Act Runner Stack to clear cache for workflows / wait-for-secondary-death (push) Successful in 32s
Reload Act Runner Stack to clear cache for workflows / pull-cache-secondary (push) Failing after 3s
update action path
2026-03-07 13:32:17 -08:00

53 lines
2.0 KiB
YAML

name: Reload Act Runner Stack to clear cache for workflows
on:
push:
branches: [main]
jobs:
diff:
uses: martin/chromart-gitea-actions/.gitea/workflows/diff-output.yaml@main
with:
files: .gitea/**
reload-primary:
needs: diff
if: ${{ needs.diff.outputs.is_changed == 'true' }}
uses: martin/chromart-gitea-actions/.gitea/workflows/gitainer-deploy.yaml@main
with:
stack_name: gitea_act_runner
# the secondary runner executes the primary restart webhook
runs_on_label: runner-secondary
reload-secondary:
needs: [diff, reload-primary]
if: ${{ needs.diff.outputs.is_changed == 'true' }}
# ensuring the primary actually survived and restarted successfully
uses: martin/chromart-gitea-actions/.gitea/workflows/gitainer-deploy.yaml@main
with:
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
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
uses: https://gitea.chromart.cc/martin/chromart-gitea-actions/.gitea/workflows/noop.yaml@main