After publishing, the job asks the live site for its version and fails if it is not the commit it published. The test ran only when the repository variable SITE_URL was set, and it was not, so a job that published to a directory nothing serves passed. The address defaults to https://pplus.scient.ing; SITE_URL still overrides it.
This commit is contained in:
3 files changed
+7
-5
No files matched your search
+1
-1
@@ -27,7 +27,7 @@ The swap is one rename, so nobody sees a half-copied site, and a rollback is `ln
|
||||
|
||||
What the runner has to bring is small: git and Node (for `actions/checkout`), bash, curl, tar, `sha256sum`, and a `/srv/www` the job can write (or rsync and SSH to the machine that has it, below). The same workflow runs on a runner in host mode (a label registered as `quarto-deploy:host`: steps run on the machine's own shell as the runner's user, which then needs those tools and write access to `/srv/www`); there pixi's package cache and the fetched pixi in `~/.cache` last from job to job.
|
||||
|
||||
`SITE_SLUG` (repository variable) names the directory under `/srv/www` and defaults to `pplus`, the directory the Caddyfile serves (it defaulted to the repository's name, and the first job on this repository published to `/srv/www/pplus-web`, which nothing serves). Set `SITE_URL` as well: it turns on a smoke test that fetches `/VERSION` from the live site and fails the job if it is not the deployed commit, which is what catches a job that publishes where nothing is served. On GitHub Actions the build and test steps run unchanged with `runs-on: ubuntu-latest`; publishing needs the droplet.
|
||||
`SITE_SLUG` (repository variable) names the directory under `/srv/www` and defaults to `pplus`, the directory the Caddyfile serves (it defaulted to the repository's name, and the first job on this repository published to `/srv/www/pplus-web`, which nothing serves). After publishing, a smoke test fetches `/VERSION` from the live site, at `SITE_URL` (repository variable, `https://pplus.scient.ing` when unset), and fails the job if it is not the deployed commit, which is what catches a job that publishes where nothing is served. On GitHub Actions the build and test steps run unchanged with `runs-on: ubuntu-latest`; publishing needs the droplet.
|
||||
|
||||
**Once the repositories are public**, a pull request from a fork runs its own workflow file and code on this runner, in a container that can write `/srv/www`. Run pull requests only from branches of the repository itself (each workflow's job has an `if:` that does that), or require approval for fork runs in Gitea's repository settings where the version offers it, or give pull requests a separate runner that cannot write the web root.
|
||||
|
||||
|
||||
Reference in new issue
Block a user