Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/mcpx-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down