script to rebuild pages

This commit is contained in:
Davide Scaini
2026-04-12 19:48:13 +02:00
parent d659b90cd9
commit 79e428ff0f
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
set -e
REPO=/opt/bincio-repo.git
DEPLOY=/opt/bincio
DATA=/var/bincio/data
echo "--- Syncing Python deps ---"
cd $DEPLOY
~/.local/bin/uv sync --extra serve --extra strava --extra garmin
echo "--- Syncing JS deps ---"
cd $DEPLOY/site
npm install --silent
echo "--- Building site ---"
cd $DEPLOY
~/.local/bin/uv run bincio render --data-dir $DATA --site-dir $DEPLOY/site
echo "--- Copying dist to webroot ---"
rsync -a --delete $DEPLOY/site/dist/ /var/www/bincio/
echo "--- Restarting API ---"
systemctl restart bincio || echo "WARNING: bincio service restart failed — check journalctl -u bincio"
echo "--- Done ---"