docs(site): document the automatic Forgejo Actions deploy
All checks were successful
ci / test-commons-core (push) Successful in 56s
ci / analyze (push) Successful in 1m51s
site / deploy (push) Successful in 36s
ci / test-app-seeds (push) Successful in 7m10s

The manual Ansible playbook was superseded by the site.yml workflow,
which deploys on every push to main touching site/** or docs/**.
Keep Ansible documented only as the manual fallback.
This commit is contained in:
vjrj 2026-07-18 00:30:05 +02:00
parent 0aa8dd91ab
commit 11cbdf3022

View file

@ -10,14 +10,21 @@ browser ── Cloudflare ── assange (nginx reverse proxy, TLS) ── grouc
``` ```
- The site source lives in this repo under `site/` (Hugo). It is **built into a - The site source lives in this repo under `site/` (Hugo). It is **built into a
static nginx image on the host** by Ansible — no Hugo on the control node, no static nginx image on the host** — no Hugo on the control node, no registry.
registry.
- `site/` builds legal + about pages from `docs/` (single source of truth) and - `site/` builds legal + about pages from `docs/` (single source of truth) and
serves screenshots generated by the Flutter golden harness. serves screenshots generated by the Flutter golden harness.
- **Deploy is automatic**: a Forgejo Actions workflow
([`.forgejo/workflows/site.yml`](../.forgejo/workflows/site.yml)) runs on every
push to `main` that touches `site/**` or `docs/**`. It rsyncs `site/` straight
to `groucho` over SSH (runner and host share the internal subnet) and rebuilds
the Hugo→nginx container — no Ansible run needed for routine content changes.
The Ansible playbook below is now only for the one-time proxy/vhost setup and
as a manual fallback (e.g. deploying uncommitted work from a worktree).
- Two separate git repos are involved: - Two separate git repos are involved:
- **Tane repo** (this one): the `site/` source, docs, and the screenshot harness. - **Tane repo** (this one): the `site/` source, docs, the screenshot harness,
- **Ansible repo**: `~/proyectos/sync/comunes/shared-l2/ansible` — the deploy and the `site` deploy workflow.
playbook and the reverse-proxy vhost. - **Ansible repo**: `~/proyectos/sync/comunes/shared-l2/ansible` — the
reverse-proxy vhost, and a manual-deploy fallback playbook.
## One-time setup (already done; only if starting fresh) ## One-time setup (already done; only if starting fresh)
@ -51,39 +58,35 @@ inventory shot changes — see the `og-tpl.sh` step in git history; optional.)
### 2. Commit & land on main ### 2. Commit & land on main
The deploy syncs from the **main checkout** by default, so commit first:
```sh ```sh
cd <tane-repo> && git add -A && git commit -m "..." cd <tane-repo> && git add -A && git commit -m "..."
git -C ~/proyectos/dev/tane merge --ff-only <your-branch> # land on main git -C ~/proyectos/dev/tane merge --ff-only <your-branch> # land on main
git -C ~/proyectos/dev/tane push origin main git -C ~/proyectos/dev/tane push origin main
``` ```
Pushing to `main` with changes under `site/**` or `docs/**` triggers the `site`
Forgejo Actions workflow automatically — nothing else to run. Watch it at
`https://git.comunes.org/comunes/tane/actions` (workflow name `site`), or
trigger it manually via `workflow_dispatch` if a push didn't touch those paths.
### 3. Deploy ### 3. Verify
```sh
cd ~/proyectos/sync/comunes/shared-l2/ansible
ansible-playbook -i comunes_inventory.ini tane-landing.yml
```
This rsyncs `site/` to `groucho:/data/tane-landing/src`, rebuilds the
Hugo→nginx image there, and recreates the container (only when the source
changed). `proxies.yml` does **not** need re-running for content changes.
### 4. Verify
```sh ```sh
curl -sI https://tane.comunes.org/ | head -1 # 200 curl -sI https://tane.comunes.org/ | head -1 # 200
curl -s https://tane.comunes.org/es/about/ | grep -o '<title>[^<]*</title>' curl -s https://tane.comunes.org/es/about/ | grep -o '<title>[^<]*</title>'
``` ```
## Deploying from a git worktree (not the main checkout) ## Manual deploy fallback (Ansible)
`tane_site_src` defaults to `$HOME/proyectos/dev/tane/site`. To deploy uncommitted Only needed if Forgejo Actions is down, the `GROUCHO_DEPLOY_KEY` secret is
work from a worktree, point it at that worktree's `site/`: missing, or you want to push uncommitted work from a worktree:
```sh ```sh
cd ~/proyectos/sync/comunes/shared-l2/ansible
ansible-playbook -i comunes_inventory.ini tane-landing.yml \ ansible-playbook -i comunes_inventory.ini tane-landing.yml \
-e tane_site_src=/abs/path/to/worktree/site -e tane_site_src=/abs/path/to/worktree/site # omit to use the main checkout
``` ```
Prefer landing on main and deploying from the main checkout for reproducibility. This rsyncs `site/` to `groucho:/data/tane-landing/src`, rebuilds the
Hugo→nginx image there, and recreates the container. `proxies.yml` does
**not** need re-running for content changes.
## Gotchas ## Gotchas