How this blog deploys — previews, going live, rolling back
Every pull request gets its own preview address, a merge to main goes live, and undoing a bad deploy is one command.
There is no server behind this blog. npm run build writes a folder of finished
HTML files, and a GitHub Actions workflow hands that folder to
One9x Pages, which serves it. This post is what happens in
between, and what to do when you want to undo something.
Turning it on, once
The workflow is already in .github/workflows/deploy.yml. It needs a site to
deploy to and a token to deploy with. With the
One9x CLI:
one9x pages create myblog
one9x tokens create "github actions"
Then in your repository, under Settings → Secrets and variables → Actions,
add a variable named ONE9X_SITE set to myblog, and a secret named
ONE9X_TOKEN holding the token. Until the variable exists the workflow is
skipped rather than failing, which is why a fresh copy of this template starts
without a red cross.
Tokens expire after 90 days. one9x tokens extend <id> pushes the date out
without changing the secret.
A pull request is a preview
Write a post on a branch and open a pull request. The workflow builds the blog
and uploads it as a new release — but does not make it live. It comments on the
pull request with the release’s own address, which looks like
v12--myblog.one9x.app. That address keeps serving that exact build, so you can
send it to someone for a read before anything is public.
Merging is publishing
A push to main builds and uploads the same way, then makes that release the
live one. The switch is atomic: readers get the whole old site or the whole new
one, never a mix of the two halfway through an upload.
Re-deploying something unchanged costs nothing. Releases are content-addressed, so files that did not change are not uploaded again.
Rolling back
Every release stays available. Pointing the site back at an earlier one is instant, because the files are already there:
one9x pages deploy --site myblog --to v11
And when you just want to undo the last deploy without looking up a number:
one9x pages deploy --site myblog --to ""
The release you rolled away from is not deleted. Fix the problem and merge again, or point the site straight back at it.