fix: create Cloudflare Pages project on first site deploy - #133
Merged
Conversation
wrangler pages deploy no longer creates a missing project in non-interactive CI, which caused the v1.10.0 memcachejs.org publish to fail. Create the project when it is absent, then deploy. Co-authored-by: Jared Wray <me@jaredwray.com>
any() returns a boolean so a missing project is exit 1 instead of jq's empty-result exit 4, which is easier to reason about in CI. Co-authored-by: Jared Wray <me@jaredwray.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 1411 1411
Branches 310 310
=========================================
Hits 1411 1411 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix for the
deploy-siteGitHub Action.The v1.10.0 site publish failed because Wrangler 4 no longer creates a Cloudflare Pages project during a non-interactive
pages deploy:That matches how
wrangler pages deploybehaves in CI: stdin is not a TTY, so it will not prompt to create the project. Every other Jared Wray Docula site already has an existing Pages project;memcacheis a first publish.What this does
On deploy, list Pages projects as JSON and create
memcachewith production branchmainwhen it is missing (jq any()), then run the samepages deployas before.After merge, re-run deploy-site via
workflow_dispatch(or the next release) so the first deployment can create the project and uploadsite/dist. Attachmemcachejs.orgas a custom domain in the Cloudflare Pages dashboard if it is not already bound.Why not Workers?
Cloudflare recommends Workers for brand-new projects, but this repo’s token, workflow, and the rest of the Docula sites still publish with Pages. Creating the missing Pages project is the smallest change that unblocks the existing pipeline.
Verification
pnpm buildsucceededpnpm test: 11 files, 630 tests passed, 100% statement/line coveragepnpm website:buildproducedsite/dist(index, changelog, assets)memcache→ skip create