ci(docs): build docs.qauth.dev on Netlify's own CD, and pin pnpm for it - #395
Merged
Conversation
Netlify now builds and deploys the site from `main` directly, so the GitHub Actions deploy is redundant and is removed. `.github/workflows/docs.yml` built the site in Actions and pushed the prebuilt output through the Netlify CLI, which needed a `NETLIFY_AUTH_TOKEN` and a `NETLIFY_SITE_ID` that were never set — so it had been failing on every push and every PR. The site's checks do not go with it: `ci.yml` runs `nx affected -t lint typecheck test build`, which covers `docs-site` and its drift invariants whenever the diff touches them. `netlify.toml` replaces it, and fixes two things that made the first Netlify build fail: **pnpm.** The root `package.json` declares `engines.pnpm: ">=11.0.0"` but pins the exact version only inside each workflow's `pnpm/action-setup` input, so an external builder has nothing to read it from. Netlify activated its bundled pnpm 10.30.3 and the install died with `ERR_PNPM_UNSUPPORTED_ENGINE` before a file was built. `PNPM_VERSION` is now stated where Netlify reads it, at the same 11.4.0 the workflows install. Deliberately not a `packageManager` field: every workflow passes an explicit `version` to `pnpm/action-setup`, and a second declaration would be a conflict to resolve rather than a pin. **The publish path.** The site was configured to publish `apps/docs-site/dist`, which is empty — `astro.config.mjs` redirects `outDir` to the workspace-level `dist/apps/docs-site` so it matches the Nx target's declared `outputs`. That mismatch would have deployed nothing and reported success once the install was fixed. Verified by running the configured command: `pnpm exec nx build docs-site` lands 120 files there. `netlify.toml` overrides the equivalent Netlify UI fields, so the build is reproducible from the repository rather than from dashboard settings nobody can review. The docs-site README's deployment section is rewritten to match, including why those two settings are load-bearing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKAC2F5PayPstKTrF2NLp9
✅ Deploy Preview for qauth-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Netlify now builds and deploys the site from
maindirectly, so the GitHub Actions deploy is redundant. This removes it and replaces it with anetlify.toml, which also fixes the two things that made the first Netlify build fail.The failure
The root
package.jsondeclaresengines.pnpm: ">=11.0.0", but the exact version is pinned only inside each workflow'spnpm/action-setupinput — so an external builder has nothing to read it from and Netlify activated its own bundled pnpm.PNPM_VERSION = "11.4.0"is now stated where Netlify looks, matching what.github/workflows/*.ymlinstall.Deliberately not a
packageManagerfield. Every workflow passes an explicitversion:topnpm/action-setup, so a second declaration would be something to reconcile rather than a pin. Consolidating onpackageManagerand dropping those three inputs is a reasonable follow-up; it is a larger change than this build needs.A second failure was queued behind it
The site was configured to publish
apps/docs-site/dist. That directory is empty —astro.config.mjsredirectsoutDirto the workspace-leveldist/apps/docs-siteso it matches the Nxbuildtarget's declaredoutputs(a declared output that does not match reality breaks Nx caching silently). Once the install was fixed, the deploy would have published nothing and reported success.Verified by running the configured command against a clean output directory:
pnpm exec nx build docs-sitelands 120 files indist/apps/docs-site.Since
netlify.tomloverrides the equivalent Netlify UI fields, no dashboard change is required — though the stale publish path is still set there and is worth correcting.What is removed, and what is not
.github/workflows/docs.ymlbuilt the site in Actions and uploaded the prebuilt output through the Netlify CLI, which needed aNETLIFY_AUTH_TOKENand aNETLIFY_SITE_IDthat were never set. It had been failing on every push tomainand every pull request.Its
nx test docs-site/nx build docs-sitesteps are not a loss:ci.ymlrunsnx affected -t lint typecheck test build, which coversdocs-site— its four drift invariants included — whenever the diff touches the project or anything it reads.Also
apps/docs-site/README.md's deployment section is rewritten to describe Netlify's CD rather than the deleted workflow, and to record whyPNPM_VERSIONandpublishare load-bearing, so the next person to hit either does not have to re-derive it from a build log.Verification
nx run-many -t lint typecheck test buildacross all 26 projects — cleannx build docs-siteinto a cleareddist/apps/docs-site— 120 files, confirming thepublishpath🤖 Generated with Claude Code
https://claude.ai/code/session_01TKAC2F5PayPstKTrF2NLp9
Generated by Claude Code