fix(deploy): publish without rsync (rm + cp fallback)

Made-with: Cursor
This commit is contained in:
ilia 2026-03-24 23:31:44 -04:00
parent b523b67587
commit 20cabdd038

8
scripts/deploy-site.sh Normal file → Executable file
View File

@ -28,7 +28,13 @@ npm run build
if [[ -d "$SITE_ROOT" ]]; then
echo "==> Publish dist/ -> $SITE_ROOT/"
rsync -av --delete "${REPO_ROOT}/dist/" "${SITE_ROOT}/"
if command -v rsync >/dev/null 2>&1; then
rsync -av --delete "${REPO_ROOT}/dist/" "${SITE_ROOT}/"
else
echo " (rsync not installed — using rm + cp; install rsync for faster syncs: apt-get install -y rsync)"
find "$SITE_ROOT" -mindepth 1 -exec rm -rf {} +
cp -a "${REPO_ROOT}/dist/." "$SITE_ROOT/"
fi
echo "==> Done. Reload nginx if needed: systemctl reload nginx"
else
echo "WARN: SITE_ROOT '$SITE_ROOT' is not a directory — not copying dist."