Skip to content

Switch auto-rebuild trigger from Cloudflare hook to workflow_dispatch#38

Merged
Aaronontheweb merged 1 commit into
devfrom
feature/release-dispatch-trigger
May 20, 2026
Merged

Switch auto-rebuild trigger from Cloudflare hook to workflow_dispatch#38
Aaronontheweb merged 1 commit into
devfrom
feature/release-dispatch-trigger

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Contributor

Summary

Replaces the Cloudflare deploy-hook plan from #36 with a workflow_dispatch trigger, because the original approach wouldn't actually work for this project's deploy setup.

Why the deploy-hook plan was wrong

Deploy hooks only fire builds inside Cloudflare Pages' Git-connected build system. This project doesn't use that path — .github/workflows/deploy.yml builds Astro on GitHub Actions runners and ships the prebuilt dist/ to Cloudflare via wrangler pages deploy. Cloudflare Pages is effectively just object storage in this architecture; it never builds the site. A deploy hook would have done nothing useful.

What this does instead

  1. .github/workflows/deploy.yml — adds a workflow_dispatch trigger alongside the existing push: [dev] one. Gives us a manual "Run workflow" button in the Actions tab and an entry point for cross-repo dispatch.
  2. ops/auto-rebuild-on-release/workflow.yml — the template that lives in the netclaw repo. Now uses gh workflow run deploy.yml --repo netclaw-dev/netclaw-website --ref dev instead of curling a Cloudflare URL.
  3. ops/auto-rebuild-on-release/README.md — rewritten with the corrected setup: create a fine-grained PAT (Actions: Read and write on netclaw-website), add it as WEBSITE_DISPATCH_TOKEN on the netclaw repo, drop the workflow file in. Also added an architecture note so the next person doesn't propose the deploy-hook approach again.

Why workflow_dispatch over repository_dispatch

Both work for cross-repo triggering. workflow_dispatch wins on:

  • Manual "Run workflow" button in the Actions UI (free debugging affordance)
  • Sender code is one gh workflow run line instead of a curl + JSON body
  • Same security model (fine-grained PAT either way)

The theoretical decoupling benefit of repository_dispatch (event name vs workflow filename) doesn't matter — we control both workflows and can rename in lockstep.

End-to-end test plan (after merge)

  1. PAT + secret are already in place on the netclaw repo (WEBSITE_DISPATCH_TOKEN).
  2. Copy ops/auto-rebuild-on-release/workflow.yml into netclaw-dev/netclaw/.github/workflows/website-rebuild.yml and push.
  3. In the netclaw repo's Actions tab → Trigger netclaw.dev rebuild → Run workflow.
  4. Confirm the workflow logs Dispatched deploy.yml on netclaw-dev/netclaw-website@dev. and that a fresh deploy run starts on netclaw-website within seconds.

Touched files

  • .github/workflows/deploy.yml — +3 lines (the new trigger)
  • ops/auto-rebuild-on-release/workflow.yml — replaced (~20 lines, simpler)
  • ops/auto-rebuild-on-release/README.md — rewritten with correct setup

The Cloudflare Pages deploy-hook approach doesn't actually work for this
project: deploy hooks fire builds inside Cloudflare's Git-connected build
system, but netclaw-website deploys via wrangler from inside
.github/workflows/deploy.yml, so Cloudflare Pages is essentially just
object storage here and never builds the site itself.

The actual rebuild trigger is deploy.yml, which only fires on push to
dev. Add a workflow_dispatch trigger so it can also be invoked manually
from the Actions tab and remotely from another repo.

Update ops/auto-rebuild-on-release/workflow.yml to use 'gh workflow run'
against the website repo instead of curling a Cloudflare hook. The
sender authenticates with a fine-grained PAT (Actions: Read and write
on netclaw-website) exposed as WEBSITE_DISPATCH_TOKEN.

Rewrite ops/auto-rebuild-on-release/README.md with the corrected setup
steps (PAT + secret instead of Cloudflare deploy hook) and an
architecture note explaining why the hook approach doesn't apply.
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) May 20, 2026 22:20
@Aaronontheweb Aaronontheweb merged commit 195e62d into dev May 20, 2026
2 checks passed
@Aaronontheweb Aaronontheweb deleted the feature/release-dispatch-trigger branch May 20, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant