This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content

April 17, 2026

Deploy your docs to GitHub Pages

By Phil Scott

Pennington's own docs site needed somewhere to live, and building locally and copying files up isn't much of a workflow. So there's now a GitHub Actions workflow that runs the static build and publishes to GitHub Pages on every push to main — the same workflow any Pennington site can use.

Push to main, your site updates

The workflow wires together two steps. It runs the static build to produce the site, then hands the output folder to GitHub Pages:

yaml
on:
  push:
    branches: [main]

Merge a pull request or push a doc fix, and the published site catches up on its own. Because the static build emits plain HTML, GitHub Pages — which has no .NET runtime — serves it without trouble.

One thing to set up front: GitHub Pages serves project sites from a sub-path like /my-repo/. Pass that sub-path as the build argument so BaseUrlHtmlRewriter prefixes internal links and assets under that prefix — CanonicalBaseUrl stays reserved for absolute canonical and feed links. The GitHub Pages how-to has the complete workflow file and the base-URL setup.

Smaller CSS in the workflow

A later follow-up wired PurgeCSS into the same workflow. Pennington generates utility CSS on demand, and PurgeCSS trims the result against the built HTML, so the published site ships only the classes it actually uses. The build job does the trimming — nothing in your project changes.