Admin: move deploy flow into settings and use secrets file

This commit is contained in:
2026-02-21 15:50:39 +03:00
parent 27691ba396
commit bc48e6959d
11 changed files with 305 additions and 136 deletions
+5
View File
@@ -7,9 +7,11 @@ set -euo pipefail
# Optional env:
# APP_DIR=/home/USER/www/photo-gallery
# BRANCH=main
# PHP_BIN=php
APP_DIR="${APP_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
BRANCH="${BRANCH:-main}"
PHP_BIN="${PHP_BIN:-php}"
cd "$APP_DIR"
@@ -42,6 +44,9 @@ fi
git fetch --all --prune
git reset --hard "origin/$BRANCH"
# Run DB migrations required by current code
"$PHP_BIN" scripts/migrate.php
# Make sure runtime files exist
[ -f data/last_indexed.txt ] || echo "0" > data/last_indexed.txt