vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Phase 7 slice 7: the build deploys the site
88e980b0e88b24a20605ceeb9e42fd0dacee7842 · Keenan Nemetz · 17d ago · parent 213f4d6d
Phase 7 slice 7: the build deploys the site
pages: {path: site} on a job publishes that directory as the site branch, using
the same snapshot code `vole pages deploy` uses — a site published by a workflow
and one published by a person have to be the same commit shape, or the version
that drifts is the one nobody runs by hand.
- workflow: pages.path validated at push — one relative directory, no glob (a
site is one tree), and only one job per workflow may declare it, since two
publishers race and the winner is whichever runner finished last
- the directory is pinned into the queued run beside the steps and the artifact
patterns; the branch comes from the server (pages_ref), which a workflow
cannot know
- runner: after the artifacts, checks that the run's SHA is still the tip of its
branch and refuses otherwise. Deploy is a snapshot, so a stale build finishing
late would silently revert the site; the failure names both commits
- the site commit says where it came from: "site: main from run <id> (<sha>)"
Fixed on the way, caught by the end-to-end test: the shared push helper treated a
URL as a missing *named* remote, so a runner's deploy committed locally and
reported success while the site 404'd. A URL is now a remote in its own right.
Measured through the binary: two pushes queued two runs; the older one was
refused ("this run built f1f415ec but main is at 6beaa530 now; the site was not
deployed") and published nothing; the newer one deployed and the site host served
the new tree, with `git log pages` showing
"site: main from run 01M5MSC3... (6beaa530)".
README.md +21
| @@ -216,6 +216,8 @@ jobs: | |||
| 216 | 216 | run: make dist | |
| 217 | 217 | artifacts: | |
| 218 | 218 | - path: dist/* | |
| 219 | pages: | ||
| 220 | path: site/ # publish this directory as the repository's site | ||
| 219 | 221 | ``` | |
| 220 | 222 | ||
| 221 | 223 | ```sh | |
| @@ -250,6 +252,21 @@ An artifact of a run is not a release artifact. It belongs to the run that built | |||
| 250 | 252 | and publishing it to a release is a separate, deliberate step (`vole release attach`), | |
| 251 | 253 | so "latest build" and "the bytes v1.0.0 ships" are never the same link. | |
| 252 | 254 | ||
| 255 | `pages:` deploys a directory as the repository's site, with the same snapshot rules as | ||
| 256 | `vole pages deploy`: the branch's tree becomes exactly those files, so a page deleted | ||
| 257 | from the build stops being served. The commit names the build that produced it | ||
| 258 | (`site: main from run 01M5... (6beaa53)`), so `git log pages` in any clone says what | ||
| 259 | put that tree there. | ||
| 260 | |||
| 261 | A deploy is refused when the run is no longer the newest commit on its branch — an | ||
| 262 | older build finishing late would otherwise revert the site to an older tree, and a | ||
| 263 | silent revert is worse than a failed job. The run log says so: | ||
| 264 | `this run built f1f415ec but main is at 6beaa530 now; the site was not deployed`. | ||
| 265 | |||
| 266 | Only one job per workflow may publish the site: two would race, and the winner would be | ||
| 267 | whichever runner finished last. The branch name is instance configuration | ||
| 268 | (`pages_ref`), so it comes from the server rather than from the workflow. | ||
| 269 | |||
| 253 | 270 | ## Large files | |
| 254 | 271 | ||
| 255 | 272 | Track a pattern with git-lfs as usual; the only thing that changes is where the bytes | |
| @@ -364,6 +381,10 @@ would publish something the author never chose. Deploying identical bytes twice | |||
| 364 | 381 | nothing. `--branch` names a different branch, which is what you pass if the operator | |
| 365 | 382 | changed `pages_ref`. | |
| 366 | 383 | ||
| 384 | A workflow can deploy the site too (`pages:` in the CI section below), which is the | ||
| 385 | usual arrangement: the build produces `dist/`, and the deploy is the last thing the job | ||
| 386 | does. | ||
| 387 | |||
| 367 | 388 | Plain git is the same thing, for a hand-written page: | |
| 368 | 389 | ||
| 369 | 390 | ```sh | |