Skip to content

fix: create Cloudflare Pages project on first site deploy - #133

Merged
jaredwray merged 2 commits into
mainfrom
cursor/cloudflare-pages-project-create-b6d7
Aug 19, 2026
Merged

fix: create Cloudflare Pages project on first site deploy#133
jaredwray merged 2 commits into
mainfrom
cursor/cloudflare-pages-project-create-b6d7

Conversation

@jaredwray

@jaredwray jaredwray commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix for the deploy-site GitHub Action.

The v1.10.0 site publish failed because Wrangler 4 no longer creates a Cloudflare Pages project during a non-interactive pages deploy:

The Pages project "memcache" does not exist.

That matches how wrangler pages deploy behaves 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; memcache is a first publish.

What this does

On deploy, list Pages projects as JSON and create memcache with production branch main when it is missing (jq any()), then run the same pages deploy as before.

After merge, re-run deploy-site via workflow_dispatch (or the next release) so the first deployment can create the project and upload site/dist. Attach memcachejs.org as 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 build succeeded
  • pnpm test: 11 files, 630 tests passed, 100% statement/line coverage
  • pnpm website:build produced site/dist (index, changelog, assets)
  • jq checks: empty list / other project → create; existing memcache → skip create
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 19, 2026 04:29
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

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b8a16c9) to head (c8527ac).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaredwray
jaredwray marked this pull request as ready for review August 19, 2026 04:39
@jaredwray
jaredwray merged commit edbe105 into main Aug 19, 2026
17 checks passed
@jaredwray
jaredwray deleted the cursor/cloudflare-pages-project-create-b6d7 branch August 19, 2026 04:39
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.

2 participants