deploy: add post-receive hook for VPS git-push workflow

This commit is contained in:
Davide Scaini
2026-06-02 15:14:18 +02:00
parent 3dafe3840b
commit 301ad44887
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -e
REPO=/opt/bincio-auth-repo.git
DEPLOY=/opt/bincio-auth
while read oldrev newrev refname; do
echo "--- Checking out $refname ---"
git --work-tree=$DEPLOY --git-dir=$REPO checkout -f $newrev
echo "--- Syncing Python deps ---"
cd $DEPLOY
~/.local/bin/uv sync
echo "--- Syncing JS deps ---"
cd $DEPLOY/site
npm install --silent
echo "--- Building site (bincio.org) ---"
PUBLIC_ACTIVITY_URL=https://activity.bincio.org \
PUBLIC_WIKI_URL=https://wiki.bincio.org \
PUBLIC_PLANNER_URL=https://planner.bincio.org \
npm run build
rsync -a --delete $DEPLOY/site/dist/ /var/www/bincio/
echo "--- Restarting bincio-auth ---"
systemctl restart bincio-auth || echo "WARNING: bincio-auth restart failed"
echo "--- Done ---"
done