From 08337f88823402197a3eb8aee7865a5c9700da01 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 19:35:29 -0600 Subject: [PATCH] docs deploy: stage the Code Book and Lab Book into the combined Pages deploy The repository has one GitHub Pages site and every deployment replaces the whole site, so the two new books from the Code Book programme (#13905) join the combined deploy in mcpx-docs.yml: code-docs built with siteUrl /code/code/ and staged under code/, lab-docs with /code/lab/ under lab/, mirroring the existing fleet/atlas/id blocks exactly. Both deploy-variant expressions were built locally before this change (index.html verified, zero mdBook warnings in either log). Refs #13905. --- .github/workflows/mcpx-docs.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/mcpx-docs.yml b/.github/workflows/mcpx-docs.yml index 7c82603ad..8f93a9d76 100644 --- a/.github/workflows/mcpx-docs.yml +++ b/.github/workflows/mcpx-docs.yml @@ -187,6 +187,58 @@ jobs: cp -rL result-id-docs site/id test -f site/id/index.html + # The Code Book (#13905, pkgs/code-book/book) shares this + # repository's single Pages site the same way: built with its + # own siteUrl and staged under code/ here, in the same deploy + # — a separate code-book-only deploy would wipe the mcpx, + # fleet, atlas and id books. Its build-only workflow is + # code-book-docs.yml; see the book's "Deploying this book" + # chapter (pkgs/code-book/book/operations/deploying-this-book.md). + - name: Nix build (Code Book, siteUrl /code/code/) + run: | + # Intentional: the single-quoted string in this block is a Nix expression + # evaluated by nix, not the shell -- ${builtins.currentSystem} in it is + # Nix's, and letting the shell expand it would break the build. + # shellcheck disable=SC2016 + nix build --impure --print-build-logs --expr \ + '(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.code-docs.override { siteUrl = "/code/code/"; }' \ + --out-link result-code-docs + + - name: Stage Code Book into site/code + run: | + rm -rf site/code + # site/ is a copy of a Nix store path: its directories are + # read-only, so make the root writable before adding code/. + chmod u+w site + cp -rL result-code-docs site/code + test -f site/code/index.html + + # The Lab Book (#13905, pkgs/lab/book) shares this + # repository's single Pages site the same way: built with its + # own siteUrl and staged under lab/ here, in the same deploy + # — a separate lab-only deploy would wipe the mcpx, fleet, + # atlas, id and Code books. Its build-only workflow is + # lab-docs.yml; see the book's "Deploying this book" chapter + # (pkgs/lab/book/operations/deploying-this-book.md). + - name: Nix build (Lab Book, siteUrl /code/lab/) + run: | + # Intentional: the single-quoted string in this block is a Nix expression + # evaluated by nix, not the shell -- ${builtins.currentSystem} in it is + # Nix's, and letting the shell expand it would break the build. + # shellcheck disable=SC2016 + nix build --impure --print-build-logs --expr \ + '(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.lab-docs.override { siteUrl = "/code/lab/"; }' \ + --out-link result-lab-docs + + - name: Stage Lab Book into site/lab + run: | + rm -rf site/lab + # site/ is a copy of a Nix store path: its directories are + # read-only, so make the root writable before adding lab/. + chmod u+w site + cp -rL result-lab-docs site/lab + test -f site/lab/index.html + - uses: actions/configure-pages@v6 - uses: actions/upload-pages-artifact@v5