Repository navigation
feat(cli): deploy from Cloudflare Workers Builds - #17
Merged
Merged
Conversation
`cloudhal deploy` now works from a fresh clone in Workers Builds (`WORKERS_CI=1`), which the Deploy to Cloudflare button sets up: - names come from the committed wrangler.jsonc (the Worker the button connected, its D1 database and R2 bucket); a database id there is used without a D1 call, an all-zero placeholder counts as none - the starter site is seeded under cloudhal.json's siteId when the checkout has none, and pushed only when the deployment lacks it - secrets stay on the Workers: only missing ones are generated, shared ones are set on both Workers together, a failed secret list stops the deploy; the deployment token is new on every build - the setup link is never printed; the first build explains how the owner sets their own setup token seedStarterSite takes an optional siteId. Guide: docs/guides/deploy-button.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <asker_17@msn.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <asker_17@msn.com>
This was referenced Oct 20, 2026
Merged
Madraka
added a commit
that referenced
this pull request
Oct 20, 2026
feat(cli): deploy from Cloudflare Workers Builds
Madraka
added a commit
that referenced
this pull request
Nov 11, 2026
ADR-0046 names field_operation_unsupported, the referrer-publish refusal, the text anchors, the untested R9 and R14 and what moves to 2b; the RFC status line says step 2 is split. The changeset drops the removed job and adds the list-values rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
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.
Why
A Deploy to Cloudflare button deploys one Worker. Cloudhal needs two, plus D1 and R2. So the button will point at a separate template repo (
cloudhal-dev/cloudhal-template) whosedeployscript iscloudhal deploy. Inside Workers Builds, every build is a fresh clone: no.cloudhal/, nosecrets.json, nostate.json. Before this change,cloudhal deployfailed with "site not found in the local store". Even with a seeded store, every build would have generated new secrets and lost what they encrypt.What
With
WORKERS_CI=1(set by Workers Builds;DeployOptions.workersBuildsin tests),cloudhal deploy:wrangler.jsonc: the connected Worker (Workers Builds requires the config to name it), theDBdatabase's name and id, and theBLOBSbucket. A known database id means no D1 call (the default build token may lack D1 permission). An all-zero placeholder id counts as no id.cloudhal.json'ssiteIdwhen the checkout has none (seedStarterSitegets an optionalsiteId). The site is pushed only if the deployment lacks it.wrangler secret liston both Workers and generates only the missing secrets (wrangler keeps every secret a deploy does not set; checked in wrangler's source). Shared secrets are set on both Workers together. Any list failure other than "not found" stops the deploy. The deployment token is new on every build.CLOUDHAL_SETUP_TOKENin the dashboard and opens the link.Outside Workers Builds nothing changes.
shipWorkersnow takes per-Worker secrets and leaves out--secrets-filewhen there is nothing to set.Guide:
docs/guides/deploy-button.md. Changeset: minor (cli, core-ts; fixed group).Tests
packages/cli/test/deploy-workers-builds.test.ts: button names, placeholder id, seed and push, secrets kept across a second fresh clone, a failed secret listdeploy,deploy-attach,multi-site-deployandsearch-deploytests passpnpm check(run alone): lint, size check, typecheck and every package's tests pass, except@cloudhal/studio#test. That task hit hook timeouts under turbo--concurrency=3on this machine (load average around 11). Run alone, Studio passes 1121/1121, and this PR touches no Studio file.The README button PR comes separately and waits until the button has been tested.
🤖 Generated with Claude Code