Skip to content

feat: make the docs site deployable to Cloudflare like the marketing sites - #6

Merged
adamXbot merged 7 commits into
mainfrom
feat/cloudflare-deploy-parity
Aug 27, 2026
Merged

feat: make the docs site deployable to Cloudflare like the marketing sites#6
adamXbot merged 7 commits into
mainfrom
feat/cloudflare-deploy-parity

Conversation

@adamXbot

Copy link
Copy Markdown
Collaborator

Brings the docs sites to parity with the marketing sites: publishable either by hand with just deploy or by Cloudflare Workers Builds on push, once the repo is connected in the dashboard.

Previously the justfile passed --assets dist --name … --compatibility-date … on the command line, which works locally but leaves Workers Builds with nothing to read. Now wrangler.jsonc carries all three and just deploy is a bare wrangler deploy, matching the marketing repos.

The part that matters: .assetsignore

I ran a real export before writing the config, which was worth doing — mint export copies repo files into its output:

LICENSE   serve.js   "Start Docs.bat"   "Start Docs.command"   justfile   scripts/

serve.js and the two Start Docs.* files are Mintlify's own double-click-to-serve helpers for air-gapped use; justfile, scripts/ and LICENSE are lifted straight out of this repo. Published as-is, every one of them is reachable over HTTP on the docs domain.

Because dist/ is regenerated on each build, the ignore file is committed at the repo root and copied into dist/ by just export.

Two things the export decided, not me

  • No 404.html. I had planned not_found_handling: "404-page" to match the marketing sites; the export carries no such file, so it stays at the default rather than pointing somewhere that does not exist.
  • unzip is not guaranteed in a CI image, so the step falls back to python3 -m zipfile.

Workers Builds

When you connect this repo, the build command is in a comment at the top of wrangler.jsonc:

npx --yes mint@latest export && rm -rf dist && mkdir -p dist \
  && (unzip -q -o export.zip -d dist || python3 -m zipfile -e export.zip dist) \
  && cp .assetsignore dist/.assetsignore

mint export needs no Mintlify account — verified, mint status reports not-logged-in and the export still succeeds. What I could not verify from here is whether Cloudflare's build image runs it cleanly; that only proves out on the first connected build.

Also

dist/ and export.zip are now gitignored. The export is ~47 MB, ~865 files, of which 42 MB is the Next.js bundle — well inside Workers' limits but a slow upload.

Adam and others added 7 commits August 26, 2026 22:33
…rketing sites are

Adds the wrangler config the Git-integration path needs, so this repo can
publish either way: `just deploy` by hand, or Cloudflare Workers Builds on
push once the repo is connected in the dashboard.

`just deploy` is now a bare `wrangler deploy` — the name, compatibility date
and assets directory live in wrangler.jsonc instead of being repeated on the
command line, matching the marketing repos.

The .assetsignore is the part that matters. Running a real export showed
`mint export` copies repo files into its output (justfile, scripts/, LICENSE)
and adds its own double-click-to-serve helpers (serve.js, Start Docs.bat,
Start Docs.command). Published as-is, all of those would be reachable over
HTTP. Because dist/ is regenerated on every build, the ignore file is
committed at the repo root and copied in by `just export`.

Two things the export decided for us rather than the other way round: it
carries no 404.html, so not_found_handling stays at its default instead of
pointing at a page that does not exist; and the unzip step falls back to
python3 -m zipfile, since `unzip` is not guaranteed in a CI image.

dist/ and export.zip are now gitignored — the export is ~47MB, most of it the
Next.js bundle.
The wrangler config points assets.directory at dist/, which is gitignored
and only exists after mint export runs. A connected repo therefore failed
with "the directory specified by assets.directory does not exist".

Workers Builds has no default build command, so this cannot be fully
automatic — but naming the script "build" makes the dashboard setting a
plain `npm run build` instead of a long shell one-liner. just export now
delegates to the same script so the steps are defined once.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ploy

These READMEs still walked through connecting the repo at dashboard.mintlify.com
and CNAMEing to cname.mintlify.app. That is not how these sites publish any more
— production is a Cloudflare Worker serving the static export.

Drops the standalone deploy sections in favour of a two-line statement near the
top, matching the website repos, and keeps the workflow list under CI where it
belongs. Also corrects a published page (develop/docs-site.mdx) and SPEC.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The link check has failed on main in every docs repo since mid-August. Current
lychee releases reject `--base .` outright ("base must either be a full URL or
an absolute local path"), so the job died before checking anything. Replaced
with --root-dir plus an external-only scheme filter; internal links and anchors
are already covered by `npm run check`, which runs first in the same job.

Separately, dash.cloudflare.com returns 403 to CI, failing docs-mantis on a link
that is fine in a browser. Excluded that host rather than accepting 403 globally,
which would mask genuinely forbidden links.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With lychee actually running again it found real breakage. docs-privacytracker
linked to `privacykey/privacytracker-docs` in eight places; the repo was renamed
to `docs-privacytracker` and GitHub's redirect had been hiding it from readers
but not from the checker.

The rest are false positives, excluded with the reason recorded next to each:
the docs domains have no DNS yet, privacykey/privacysentinel is a private repo
so anonymous CI gets a 404 on a correct link, and shell.azure.com bot-blocks CI.
Verified locally: all four repos now report 0 errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The docs use http://localhost:3000 in examples. Those resolved on a dev machine
with the preview running, which is why this only surfaced in CI, where nothing
listens on the port and lychee reported connection refused.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lychee exits non-zero on a timeout as well as on a broken link, so one slow
third-party host (tauri.app, in the run that prompted this) fails the whole PR
with zero actual errors reported. 30s and five retries instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adamXbot
adamXbot merged commit a08f426 into main Aug 27, 2026
1 check passed
@adamXbot
adamXbot deleted the feat/cloudflare-deploy-parity branch August 27, 2026 10:21
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