Switch auto-rebuild trigger from Cloudflare hook to workflow_dispatch#38
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the Cloudflare deploy-hook plan from #36 with a
workflow_dispatchtrigger, 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.ymlbuilds Astro on GitHub Actions runners and ships the prebuiltdist/to Cloudflare viawrangler 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
.github/workflows/deploy.yml— adds aworkflow_dispatchtrigger alongside the existingpush: [dev]one. Gives us a manual "Run workflow" button in the Actions tab and an entry point for cross-repo dispatch.ops/auto-rebuild-on-release/workflow.yml— the template that lives in the netclaw repo. Now usesgh workflow run deploy.yml --repo netclaw-dev/netclaw-website --ref devinstead of curling a Cloudflare URL.ops/auto-rebuild-on-release/README.md— rewritten with the corrected setup: create a fine-grained PAT (Actions: Read and writeonnetclaw-website), add it asWEBSITE_DISPATCH_TOKENon 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_dispatchoverrepository_dispatchBoth work for cross-repo triggering.
workflow_dispatchwins on:gh workflow runline instead of a curl + JSON bodyThe 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)
WEBSITE_DISPATCH_TOKEN).ops/auto-rebuild-on-release/workflow.ymlintonetclaw-dev/netclaw/.github/workflows/website-rebuild.ymland push.Dispatched deploy.yml on netclaw-dev/netclaw-website@dev.and that a freshdeployrun starts onnetclaw-websitewithin 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