Build and deploy via GitHub Actions - #1
Merged
Conversation
The site was built locally and its output committed to a second repo (libdither/dither.link-build) mounted as the `public` submodule. That arrangement dates to 2022-04-18, when a CI workflow was tried and dropped the same day: it ran non-extended Hugo (the book theme needs extended for SCSS), never ran mdbook so /docs/ was missing, and actions/deploy-pages did not exist yet. None of those blockers still apply. Pushes to main now build and deploy straight to Pages: - add .github/workflows/deploy.yml, pinning hugo-extended 0.115.0, mdbook 0.4.31 and mdbook-katex 0.5.4 to match the nix devshell. Checkout is recursive because /docs/ comes from dither-spec and static/disp/interactive-walkthrough.html is a symlink into disp. - add build.sh, shared by the devshell and CI. It clears public/ first, which drops stale fingerprinted assets that had accumulated since Hugo never removes old output. - drop the public submodule and gitignore the directory; stop tracking .hugo_build.lock. - remove build-push.sh, and fix the flake buildPhase, which invoked `hugoix` and so had never worked. Verified: build.sh output is byte-identical to the last published build, minus two orphaned search-index files from an older run. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
book.toml sets src = ".", so mdbook copies every non-markdown file in the submodule into /docs/. Locally that pulled in .git and a nested public/docs tree left by running mdbook there without -d -- the latter is on the live site today. A fresh CI checkout has neither, so removing them makes a local build byte-identical to the CI artifact (190 files). Co-Authored-By: Claude <noreply@anthropic.com>
zyansheep
force-pushed
the
ci/github-actions-deploy
branch
from
July 27, 2026 21:12
8930366 to
e312552
Compare
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.
Replaces the local-build + second-repo publishing setup with a GitHub Actions deploy.
Why it was the old way
All on 2022-04-18, in four commits: a CI workflow was added (
1824e2d), then the build dir was converted to a submodule (8ffe8c5), then the workflow was removed (7fac135). The workflow it gave up on couldn't have worked:# extended: truewas commented out, but thehugo-booktheme compiles SCSS and needs Hugo extendedhugo, nevermdbook— the whole/docs/half of the site would have been missingactions/deploy-pagesdidn't exist yet, so the only option was pushing to a branch, which conflicts withpublic/being a submoduleNone of those still apply. Pages on this repo is already set to
build_type: "workflow".What changes
.github/workflows/deploy.yml— builds on push tomainand on PRs, deploys only frommain. Pins hugo-extended 0.115.0 / mdbook 0.4.31 / mdbook-katex 0.5.4 to match the nix devshell, installed from prebuilt binaries (~10s, nocargo install).build.sh— one build path shared by the devshell and CI. Clearspublic/first, which drops stale fingerprinted assets that had piled up because Hugo never removes old output.publicsubmodule and gitignores the directory.libdither/dither.link-build(7.6 MB of committed build output vs 1.4 MB of source) stops being written to.build-push.sh; fixes the flakebuildPhase, which calledhugoixand had therefore never worked.Two things that are load-bearing and easy to break later:
submodules: recursiveis required —/docs/is built fromdither-spec, andstatic/disp/interactive-walkthrough.htmlis a symlink into thedispsubmodule that Hugo follows.dither-spec/book.tomlsetssrc = ".", so mdbook copies every non-markdown file in the submodule into/docs/. Locally that swept in.gitand a nestedpublic/docs/tree left by running mdbook there without-d— the latter is on the live site today.build.shstrips both so local builds match a fresh CI checkout.Verification
The CI Pages artifact was downloaded and diffed against a local
./build.sh: identical, 190 files, with/docs/, the symlinked disp page,CNAMEand404.htmlall present.Against the currently-published site the only differences are removals: two orphaned search-index files from an older build, and the nested
docs/public/tree. Nothing links to either.After merge
The first deploy lands at https://libdither.github.io/dither.link/. The
dither.linkcustom domain still points atdither.link-builduntil it's moved over — DNS is unchanged, but GitHub re-provisions the TLS cert, which takes a few minutes.Investigated, written and verified by Claude (Claude Code) on behalf of @zyansheep. The code, commit messages and this description were all drafted by Claude; commits carry a
Co-Authored-Bytrailer.