From 5432793441333e1f08390e8e9b1a55aac82e5211 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 19 Aug 2026 04:29:19 +0000 Subject: [PATCH 1/2] fix: create Cloudflare Pages project on first site deploy 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 --- .github/workflows/deploy-site.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-site.yaml b/.github/workflows/deploy-site.yaml index f5b115d..04121e5 100644 --- a/.github/workflows/deploy-site.yaml +++ b/.github/workflows/deploy-site.yaml @@ -38,8 +38,16 @@ jobs: # without hitting the anonymous GitHub API rate limit. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # wrangler pages deploy will not create a project in CI (stdin is not a + # TTY). Create "memcache" on first publish so a new site can go live. - name: Publish to Cloudflare Pages env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - run: pnpm exec wrangler pages deploy site/dist --project-name=memcache --branch=main --commit-dirty=true + run: | + set -euo pipefail + if ! pnpm exec wrangler pages project list --json \ + | jq -e '.[] | select(."Project Name" == "memcache")' >/dev/null; then + pnpm exec wrangler pages project create memcache --production-branch=main + fi + pnpm exec wrangler pages deploy site/dist --project-name=memcache --branch=main --commit-dirty=true From c8527ac67d78aad8956488d8fcc27b2944b4caff Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 19 Aug 2026 04:33:23 +0000 Subject: [PATCH 2/2] fix: use jq any() when checking for the Pages project 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 --- .github/workflows/deploy-site.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-site.yaml b/.github/workflows/deploy-site.yaml index 04121e5..b18b585 100644 --- a/.github/workflows/deploy-site.yaml +++ b/.github/workflows/deploy-site.yaml @@ -47,7 +47,7 @@ jobs: run: | set -euo pipefail if ! pnpm exec wrangler pages project list --json \ - | jq -e '.[] | select(."Project Name" == "memcache")' >/dev/null; then + | jq -e 'any(.[]; ."Project Name" == "memcache")' >/dev/null; then pnpm exec wrangler pages project create memcache --production-branch=main fi pnpm exec wrangler pages deploy site/dist --project-name=memcache --branch=main --commit-dirty=true