Skip to content

Build and deploy via GitHub Actions - #1

Merged
zyansheep merged 3 commits into
mainfrom
ci/github-actions-deploy
Jul 27, 2026
Merged

Build and deploy via GitHub Actions#1
zyansheep merged 3 commits into
mainfrom
ci/github-actions-deploy

Conversation

@zyansheep

@zyansheep zyansheep commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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: true was commented out, but the hugo-book theme compiles SCSS and needs Hugo extended
  • it only ran hugo, never mdbook — the whole /docs/ half of the site would have been missing
  • actions/deploy-pages didn't exist yet, so the only option was pushing to a branch, which conflicts with public/ being a submodule

None of those still apply. Pages on this repo is already set to build_type: "workflow".

What changes

  • .github/workflows/deploy.yml — builds on push to main and on PRs, deploys only from main. 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, no cargo install).
  • build.sh — one build path shared by the devshell and CI. Clears public/ first, which drops stale fingerprinted assets that had piled up because Hugo never removes old output.
  • Drops the public submodule 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.
  • Removes build-push.sh; fixes the flake buildPhase, which called hugoix and had therefore never worked.

Two things that are load-bearing and easy to break later:

  • submodules: recursive is required — /docs/ is built from dither-spec, and static/disp/interactive-walkthrough.html is a symlink into the disp submodule that Hugo follows.
  • dither-spec/book.toml sets src = ".", so mdbook copies every non-markdown file in the submodule into /docs/. Locally that swept in .git and a nested public/docs/ tree left by running mdbook there without -d — the latter is on the live site today. build.sh strips 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, CNAME and 404.html all 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.link custom domain still points at dither.link-build until 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-By trailer.

zyansheep and others added 3 commits July 27, 2026 14:11
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
zyansheep force-pushed the ci/github-actions-deploy branch from 8930366 to e312552 Compare July 27, 2026 21:12
@zyansheep
zyansheep merged commit 9cfcf6e into main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant