2026-09-08

2026-09-08 | joeac's blog

I've just got a git hook working, so that my website updates itself after a push to main.

To do this, you need a script in your remote repository called `hooks/post-update`. Given that I'm hosting my gemini:// capsule on the same machine, but the https:// website on another one on the same network, my script looks a little like this:

#!/bin/sh

log=~nginx/logs/joeac.net.git-post-update.log
echo "pushing changes to https://joeac.net and gemini://joeac.net"
(
ssh <user>@<http_machine> 'git -C <dir> pull; make -C <dir>/gemini'
git -C <dir> pull
make -C <dir>/gemini
) 2>> $log 1>&2 &

A few tricks: