Title: mcpx docs: build the site in CI and deploy to GitHub Pages · Issue #1941 · developing-today/code · GitHub
Open Graph Title: mcpx docs: build the site in CI and deploy to GitHub Pages · Issue #1941 · developing-today/code
X Title: mcpx docs: build the site in CI and deploy to GitHub Pages · Issue #1941 · developing-today/code
Description: Relocated from dezren39/darwin-nix#118 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/ni...
Open Graph Description: Relocated from dezren39/darwin-nix#118 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc...
X Description: Relocated from dezren39/darwin-nix#118 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue refe...
Opengraph URL: https://github.com/developing-today/code/issues/1941
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx docs: build the site in CI and deploy to GitHub Pages","articleBody":"Relocated from dezren39/nix#118 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).\n\nParent: #90\n\n## Summary\n\nBuild the docs site in CI and publish it to GitHub Pages: pull requests build only, and pushes to `main` deploy. The build has to produce the `mcpx` binary first, because the reference pages are generated from it. The real decision is where the built site is published, because `dezren39/nix` is the whole nix-config monorepo and GitHub allows one Pages site per repository.\n\n## Original notes\n\n> - documentation\n> - make a book using whatever is the most common and simple modern choice\n> - github static setup. separately, assign a subdomain\n\n(\"separately, assign a subdomain\" is #119.)\n\n## Current state\n\n- `dezren39/nix` is public and has no Pages site: `gh api repos/dezren39/nix/pages` returns 404.\n- The user site `dezren39/dezren39.github.io` is published from a branch (`build_type: legacy`, `master` `/`) with custom domain `www.drewrypope.com` and HTTPS enforced. So a project site from `dezren39/nix` would appear at `https://www.drewrypope.com/nix/` unless it gets its own custom domain (#119).\n- `github.com/dezren39/mcpx` is the Go module path, but that repository does not exist (`gh api repos/dezren39/mcpx` returns 404).\n- CI:\n - `.github/workflows/mcpx.yml` runs on PRs touching `pkgs/mcpx/**`, `flake.nix`, `flake.lock` or itself, and on pushes to `main` touching `pkgs/mcpx/**`.\n - It installs Nix (`DeterminateSystems/nix-installer-action`), Go, Deno, Bun and Node, runs `go test ./...`, and repairs `vendorHash` on bot branches.\n - Its permissions are `contents: write`, `pull-requests: read`.\n - The only other workflow is `opencode.yml`.\n- `package.nix` postInstall already runs the built binary (`$out/bin/mcpx man`, `mcpx completion ...`). A docs derivation can do the same with `mcpx` as a build input.\n\n## What the build must do (any approach)\n\n1. **Build `mcpx`**, then run it to emit the generated reference pages (#144 / #145): settings, commands, OpenAPI, tool types. The docs can then never describe a binary other than the one built from the same commit.\n2. **Run the generator** chosen in #117, plus the history renderer (#151) and the agent twin (#120).\n3. **Bake in the base URL.** The site root is `/` with a custom domain and `/nix/` without one. Take it as a derivation argument so a local build and a CI build differ only in that value.\n\n**Nix or setup-\\* actions.** Recommended: `nix build .#mcpx-docs`, a flake output that depends on `.#mcpx`. It is the same build locally and in CI, it is covered by #49's \"build every output\" job for free, and the generator version is pinned by `flake.lock`. The alternative is `setup-go` plus a generator action. That is faster on a cold runner but drifts from the local build, and it duplicates the pinning. Mitigate Nix's cold-start cost with a Nix store cache (cachix, or the Actions cache via `nix-community/cache-nix-action`), as #49 proposes for all packages.\n\n**Triggers and path filters.**\n- Deploy on push to `main` touching `pkgs/mcpx/**`, `flake.lock` (a generator or nixpkgs bump) or the workflow file.\n- On PRs with the same paths: build only, upload the site as an ordinary artifact, and run the docs checks.\n- Also run on `workflow_dispatch`, for redeploys.\n- Use a `concurrency: { group: pages, cancel-in-progress: false }` group so two deploys cannot interleave.\n\n**A separate workflow file** (`mcpx-docs.yml`) rather than a job in `mcpx.yml`. A Pages deploy needs `pages: write` and `id-token: write` plus the `github-pages` environment. `mcpx.yml` needs `contents: write` to push hash fixes. Keeping the two apart keeps each job's token minimal.\n\n**PR previews.** GitHub Pages has no native PR previews. The options, cheapest first:\n1. **None.** Reviewers download the PR's build artifact and open it locally, e.g. with `nix run .#mcpx-docs-serve`, a tiny static server. Recommended to start with.\n2. **`rossjrw/pr-preview-action`** or `koizuka/pr-preview-action`. These only work when Pages is deployed **from a branch**, so they are incompatible with Approach C below.\n3. **A separate preview repository** (e.g. `EndBug/pages-preview`) with its own Pages site. It needs a PAT, and the previews live at a different base URL.\n4. **An external host with previews** (Cloudflare Pages, Netlify). That adds a service and an account.\n\nDocs checks (links, generated pages current, agent twin in sync) run in CI; see the testing trackers under #91 (CI pipeline #95, integration/environments #97).\n\n## Approaches: where the built site is published\n\n### Approach A (least recommended): a `gh-pages` branch in `dezren39/nix`, pushed by CI\n\nThis is the classic setup, and the one most PR-preview actions assume.\n\nWhy not:\n- It commits generated HTML into the config monorepo on every docs change, so the branch grows forever and the history fills with bot commits.\n- The workflow needs `contents: write` on this repository in order to push.\n- It is GitHub's \"legacy\" publishing mode.\n- The only thing it buys is option 2 of the PR previews above. That is not worth a permanently growing branch in a repository whose clones every machine pulls.\n\n### Approach B (middle): push the built site to a separate repository\n\nFor example `dezren39/mcpx-docs`, with its own Pages site and custom domain.\n\n- It keeps generated output out of the monorepo, allows several docs sites (one per package) without the one-site-per-repo limit, and a separate preview repository becomes natural.\n- Costs: a PAT or deploy key stored as a secret in `dezren39/nix`, a second repository to keep alive, and a history of generated commits there instead.\n- **Do not use `dezren39/mcpx` for this.** That name is the Go module path. If mcpx ever gets its own repository (so that `go install github.com/dezren39/mcpx/cmd/mcpx@latest` works), that repository must hold the code. If the code moves there, its docs should move with it and Approach C applies in that repository.\n\n### Approach C (recommended): the Actions artifact deploy from `dezren39/nix`, with its own custom domain\n\n- Set the Pages source to \"GitHub Actions\" (`gh api repos/dezren39/nix/pages -X POST -f build_type=workflow`).\n- The workflow builds `.#mcpx-docs`, then runs `actions/upload-pages-artifact` followed by `actions/deploy-pages` in the `github-pages` environment.\n- No generated file is ever committed anywhere, and no extra repository or secret is needed.\n- It is GitHub's current recommended mode. It also means a `CNAME` file is ignored and not needed: the custom domain is a repository setting ([GitHub docs](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site)). See #119.\n- The `github-pages` environment's default protection only allows deploys from the default branch, which is what we want.\n\nLimits:\n- One site per repository. If other flake packages later want docs, they share this site under subpaths, which is the open question in #117.\n- No branch-based PR previews (options 1, 3 and 4 still work).\n\n## Open questions\n\n1. One site for the whole monorepo with mcpx at the root, or an mcpx-only site? This decides whether a second package's docs would push towards Approach B.\n2. Deploy on every `main` push touching mcpx, or only on release tags once #158 exists? The install page must not document a channel before it is live, so release-gated deploys (or at least release-gated install instructions) may be needed.\n3. Is the Nix cold-start time acceptable for a docs deploy? Measure with `gh run view --log` on the first runs, and compare with `mcpx.yml` timings.\n4. Should the docs build be required on `main` together with the mcpx build (#49 proposes making the mcpx check required)?\n\n## Ease · Impact · Related\n\n**Ease** M (workflow + flake output; most of the effort is the flake output that runs `mcpx` to generate pages) · **Impact** high (nothing is public without it) · **Depends on / related**: #117 (generator), #119 (domain), #120, #144, #145, #151, #158, #49\n\nSecurity/auth deferred; see tracker.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:37:56Z","url":"https://github.com/developing-today/code/issues/1941"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8e97f60b-e3c0-a2c4-35ac-92564dfa82b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E542:138048:306510:3FA07D:6B06169F |
| html-safe-nonce | e7330e155f7d86f44cfb1411200fbacecc39c7eeb19d09a8ba52bc466f5f2091 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTQyOjEzODA0ODozMDY1MTA6M0ZBMDdEOjZCMDYxNjlGIiwidmlzaXRvcl9pZCI6Ijg1ODE2MDE4NTQ3MzAxNDc0ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e3a3e7c9115a1ba203bddcb7bed464a3f9857a5b0b509f86c1082d13c72ab070 |
| hovercard-subject-tag | issue:6088793963 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1941/issue_layout |
| twitter:image | https://opengraph.githubassets.com/258b663c1353cdd7dc2c1d7837385c51e6ed923302d4d6ad13c7c92f30c5726c/developing-today/code/issues/1941 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/258b663c1353cdd7dc2c1d7837385c51e6ed923302d4d6ad13c7c92f30c5726c/developing-today/code/issues/1941 |
| og:image:alt | Relocated from dezren39/darwin-nix#118 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue referenc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width