From eb77cf69023c47d763c1cda37856cb77160b518c Mon Sep 17 00:00:00 2001 From: Alex Maldonado Date: Fri, 13 Nov 2026 06:26:50 -0500 Subject: [PATCH] Publish to the directory the site is served from The deploy job's directory under /srv/www defaulted to the repository's name. This repository is pplus-web and the site is served from /srv/www/pplus, so the first job that passed here published to /srv/www/pplus-web and the live site stayed as it was. The default is pplus; SITE_SLUG still overrides it. --- .gitea/workflows/deploy.yml | 6 ++++-- CHANGELOG.md | 1 + docs/deploy.md | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 6ff5f14..4bf548a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -13,7 +13,7 @@ # a host that serves /srv/www, so it is the droplet's. # # Repository -> Settings -> Actions -> Variables (all optional): -# SITE_SLUG the directory under /srv/www (defaults to the repository name) +# SITE_SLUG the directory under /srv/www (defaults to pplus, the directory docs/Caddyfile serves) # SITE_URL e.g. https://pplus.scient.ing, turns on the smoke test name: Build, test, deploy on: @@ -92,7 +92,9 @@ jobs: - name: Publish to /srv/www if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' env: - SLUG: ${{ vars.SITE_SLUG || github.event.repository.name }} + # not the repository's name: the site is served from /srv/www/pplus, and a job that published to + # /srv/www/pplus-web succeeded while the live site stayed as it was + SLUG: ${{ vars.SITE_SLUG || 'pplus' }} GITHUB_SHA: ${{ github.sha }} run: scripts/deploy.sh "$SLUG" diff --git a/CHANGELOG.md b/CHANGELOG.md index 934993e..47569c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ No version has been tagged yet. What programs mean is pplus-core's, and its chan ### Fixed +- The deploy job publishes to `/srv/www/pplus`, the directory the site is served from, unless `SITE_SLUG` says otherwise. Its default was the repository's name, so the job published to `/srv/www/pplus-web` and the live site did not change. - `docs/Caddyfile` served the page in place at a missing nested path, where its own files could not be found (a blank page). A missing page is sent to `/`; a missing file is a plain 404. - Core's limits reach the site: no text in a pane, a link or a file ends in the engine's own error; a CSV export cannot start a spreadsheet formula; a framed Quarto view cannot make itself taller than 4,000px. - From the library, the nav's Problems and Reference links opened nothing. diff --git a/docs/deploy.md b/docs/deploy.md index b8b4d53..81741e9 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -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 and defaults to the repository name; set it to `pplus`. `SITE_URL` turns on a smoke test that fetches `/VERSION` from the live site and fails the job if it is not the deployed commit. 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). 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. **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.