From 4dbdd936f55393dd7042793c05762492079b8107 Mon Sep 17 00:00:00 2001 From: ffaerber Date: Wed, 8 Jul 2026 09:54:41 +0200 Subject: [PATCH] feat(ci): auto-dispatch homelab deploy after image push --- .gitea/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index b421c94..a26f7a0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -39,4 +39,17 @@ jobs: tags: | ${{ env.IMAGE }}:latest ${{ env.IMAGE }}:${{ gitea.sha }} - provenance: false \ No newline at end of file + provenance: false + + # Hand off to the homelab stack: dispatch its deploy workflow so the swarm re-resolves + # :latest and rolls the homepage service. Deterministic — no agent involved. TOKEN_DEPLOY + # is the `deploy` bot (write:repository, write collaborator on ffaerber/homelab only). + - name: Trigger homelab deploy + env: + TD: ${{ secrets.TOKEN_DEPLOY }} + run: | + [ -n "$TD" ] || { echo "TOKEN_DEPLOY not set - skipping deploy dispatch"; exit 0; } + curl -sS -o /dev/null -w "homelab deploy dispatch -> HTTP %{http_code}\n" -X POST \ + -H "Authorization: token $TD" -H "Content-Type: application/json" \ + "${GITHUB_SERVER_URL}/api/v1/repos/ffaerber/homelab/actions/workflows/deploy.yml/dispatches" \ + -d '{"ref":"main"}'