Skip to content

ci: deploy docs to cloudflare pages instead of github pages - #34

Merged
Datzu712 merged 3 commits into
mainfrom
ci/cloudflare-pages-deploy
Jul 27, 2026
Merged

Datzu712 merged 3 commits into
mainfrom
ci/cloudflare-pages-deploy

Conversation

@Datzu712

@Datzu712 Datzu712 commented Jul 27, 2026 •

Copy link
Copy Markdown
Owner

GitHub Pages offers no traffic analytics and no per-PR preview of the rendered site. The docs move to Cloudflare Pages, which provides both.

The site moves to nodecord.pages.dev, which drops the /nodecord/ baseUrl. GitHub Pages keeps serving a small redirect site, added under .github/pages-redirect, because the readmes published to npm in 0.2.0 link to datzu712.github.io/nodecord and those tarballs cannot be edited. Deep links are preserved through 404.html, which GitHub Pages serves for every unmatched path.

TODO: This PR requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repository secrets.

Datzu712 added 3 commits July 27, 2026 13:01
GitHub Pages offers no traffic analytics and no per-PR preview of the
rendered site. The docs move to Cloudflare Pages, which provides both.

deploy.yml keeps building with pnpm and turbo, exactly as before, and
hands the artifact to wrangler instead of upload-pages-artifact. Building
in Actions rather than through Cloudflare's git integration keeps the
deploy definition in the repository where it can be reviewed in a pull
request, and avoids configuring pnpm workspace builds in a dashboard.

test-deploy.yml now publishes a preview deployment per pull request
rather than only checking that the site compiles. A build passing is not
evidence that the page renders correctly: prettier recently collapsed the
fenced code blocks in installation.mdx onto one line and the build stayed
green, because MDX does not error on that.

The site moves to nodecord.pages.dev, which drops the /nodecord/ baseUrl.
GitHub Pages keeps serving a small redirect site, added under
.github/pages-redirect, because the readmes published to npm in 0.2.0
link to datzu712.github.io/nodecord and those tarballs cannot be edited.
Deep links are preserved through 404.html, which GitHub Pages serves for
every unmatched path.

Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repository
secrets, and a Cloudflare Pages project named nodecord.
The deploy failed at the "Installing Wrangler" step with pnpm exiting 1.

wrangler-action picks a package manager by looking for a lock file, so it
chose pnpm. wrangler depends on workerd, which has a postinstall script,
and pnpm 11 refuses to run build scripts that are not approved under
allowBuilds in pnpm-workspace.yaml, exiting 1 with ERR_PNPM_IGNORED_BUILDS.
Reproduced in a scratch workspace: pnpm add wrangler exits 1, npm install
wrangler exits 0.

Adding workerd to allowBuilds would approve build scripts for a package
that is not a dependency of this project, so the package manager used to
install the action's own tooling is pinned to npm instead.

The action also moves to v4, which runs on node24 and clears the Node 20
deprecation warning on the runner. deployment-url, which the preview job
reports, still exists in v4.
Replaces the previous packageManager: npm workaround.

wrangler-action resolves a pre-installed wrangler before falling back to
installing one. When wranglerVersion is left unset and the binary is
already resolvable, the action reports "using pre-installed wrangler
version" and skips installation entirely, so the deployed version is the
one pinned in pnpm-lock.yaml rather than whatever is latest at run time.

wrangler is added to the workspace root devDependencies, and workerd, its
transitive dependency with a postinstall script, is approved under
allowBuilds. Without that approval pnpm 11 exits 1 with
ERR_PNPM_IGNORED_BUILDS, which is what broke the deploy in the first
place.

Verified: pnpm install --frozen-lockfile exits 0 with no ignored builds,
pnpm exec wrangler --version (the command the action runs to detect an
existing install) reports 4.114.0, and build and tests still pass.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
nodecord f697b77 Jul 27 2026, 07:24 PM

@Datzu712
Datzu712 merged commit 6522bfa into main Jul 27, 2026
6 of 8 checks passed
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.

1 participant