A post on this blog goes live by a push that carries one directory and nothing else. The command that does it has no argument that widens what it copies, and it refuses to push when the site's own renderer would refuse any post. Nothing a person is working on elsewhere in the repository can ride along, and a malformed post cannot fail quietly after the push.
That is the decision. The rest of this post is the manual process it replaced, why the obvious fix was dangerous, and the failure it is built around.
What publishing used to be
A post is one Markdown file and touches nothing that runs. Publishing it took three acts, all by hand. Build the whole landing site locally, upload the result, then commit the file so that the next build from git would not quietly rebuild the site without it.
The first post also took three of those cycles instead of one, because the working tree carried other unshipped work and each deploy had to be built from a detached copy to keep that work out.
The deploy was never the necessary part
The production branch is built on every push, unattended. This site is prerendered and ships no JavaScript, so a post does need a build, but it does not need the build on the writer's machine. It needs a push.
Why not push the branch
A push of a branch takes everything on it. This repository routinely carries work that is deliberately not shipped yet. On the day this was written, one branch held a change to a tool description that had to stay out of production until a review at a client returned a decision. Pushing that branch to publish a post would have shipped the change into the review.
So the commit is built, not pushed:
- A throwaway worktree is checked out, detached, at the production branch.
- The only path copied into it is the blog's content directory. There is no argument that changes that, so the safety does not depend on whoever runs it remembering what else is on their branch.
- The directory is mirrored, not merged. It is removed and then copied, so a post that was deleted travels as a deletion.
- A dry run builds the commit, prints it and throws it away, because the useful question about this command is what would be in the commit, and that has to be answerable before a push that cannot be taken back.
A refused post publishes nothing, and says nothing
The renderer refuses anything outside this site's house style by throwing: an image, a numbered list, a level-four heading, an unclosed code fence. That is right. A post that would not look like this site should fail rather than ship.
It was safe while a person built the site locally and watched the build. Move the build to the production host and the same refusal becomes quiet. The host keeps serving the previous version, so a malformed post does not publish a bad page. It publishes nothing, and nothing says so. The symptom is a post that never appears.
So the refusal is met before the push. A check reads every post and calls the renderer, and the publish command runs it first and refuses to push when it fails. It uses the same module the pages render through, not a second parser written for the checker. A second parser would agree with the build on the day it was written and stop agreeing afterwards. What the check accepts, the build renders.
What this does not cover
- The check covers the posts, not the build. Routes, the sitemap and the prerender come from other code, and a build that fails for a reason other than a post is still quiet.
- Some of it was argued rather than observed. When the decision was written, a post failing the production build had never been provoked, a deletion had never travelled through the mirror, and nothing had yet gone wrong in the direction the narrow door was built against.
- Live does not mean instant. The command does not wait for the build. The first post published this way answered eighty seconds after the push, and the command itself says to give it a couple of minutes.
The rule, once
A post is published by a push of the blog's directory alone, after the site's own renderer has accepted every post, because a post the build refuses is a post that silently never appears. Every tool and what it refuses is listed in the docs.