Pushing to publish

Notes on wiring a git push straight through to a live page.

The deploy path for this site is deliberately boring: git push, and a hook on the receiving end checks out the new commit, builds it, and swaps a symlink over to the fresh output. No dashboard, no separate deploy button, nothing to forget to run.

Getting the details right took longer than the idea suggests — resolving Node through nvm in a hook’s non-interactive shell, keeping a handful of previous releases around so a bad push is one symlink flip away from undone, making sure the swap itself is atomic so a build never gets served half-written. All of it in service of one property: pushing a commit is publishing.

All writing