[INFRA] Push-to-render: post-receive hook + nginx #7

Closed
opened 2026-04-10 14:57:52 +00:00 by vigilio · 1 comment
Owner

Wire Forgejo push → Hugo build → nginx serves updated site.

Post-receive hook (Forgejo repo settings → Git Hooks → post-receive):

#!/bin/bash
cd ~/projects/asw
git pull
npm ci --prefer-offline
hugo --minify

nginx: update asw.trentuna.com root from ~/projects/asw-site/ to ~/projects/asw/public/

Verify: git push from local clone → site updates within seconds at asw.trentuna.com

Wire Forgejo push → Hugo build → nginx serves updated site. Post-receive hook (Forgejo repo settings → Git Hooks → post-receive): ```bash #!/bin/bash cd ~/projects/asw git pull npm ci --prefer-offline hugo --minify ``` nginx: update asw.trentuna.com root from ~/projects/asw-site/ to ~/projects/asw/public/ Verify: git push from local clone → site updates within seconds at asw.trentuna.com
vigilio added this to the M1: Framework Foundation milestone 2026-04-10 14:57:52 +00:00
Author
Owner

Push-to-render pipeline complete:

  • nginx: asw.trentuna.com server block now serves static Hugo output from ~/projects/asw/public/
  • Forgejo webhook: registered → calls http://172.17.0.1:9073/rebuild on push to main
  • asw-rebuild.service: systemd service running ~/os/asw-rebuild-webhook.py on port 9073
  • asw-rebuild.sh: checkout from bare repo → postcss (pre-builds CSS) → hugo --minify
  • Forgejo app.ini: [webhook] ALLOWED_HOST_LIST = 172.17.0.1 to allow intra-docker calls

Note: Hugo Pipes runs PostCSS from a temp dir (breaks relative paths). Workaround: pre-process CSS with postcss-cli before Hugo, reference assets/css/asw-built.css directly (no postCSS pipe in baseof.html).

Builds succeed. Site returns HTTP 200 for all pages.

Push-to-render pipeline complete: - **nginx**: `asw.trentuna.com` server block now serves static Hugo output from `~/projects/asw/public/` - **Forgejo webhook**: registered → calls `http://172.17.0.1:9073/rebuild` on push to main - **`asw-rebuild.service`**: systemd service running `~/os/asw-rebuild-webhook.py` on port 9073 - **`asw-rebuild.sh`**: checkout from bare repo → postcss (pre-builds CSS) → hugo --minify - **Forgejo app.ini**: `[webhook] ALLOWED_HOST_LIST = 172.17.0.1` to allow intra-docker calls Note: Hugo Pipes runs PostCSS from a temp dir (breaks relative paths). Workaround: pre-process CSS with postcss-cli before Hugo, reference `assets/css/asw-built.css` directly (no postCSS pipe in baseof.html). Builds succeed. Site returns HTTP 200 for all pages.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: trentuna/asw#7
No description provided.