nkbmusic/server/deploy-site.sh
metatroncubeswdev 5721eb53c9 Website deploy script and clean URLs for the legal pages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:39:00 -04:00

17 lines
638 B
Bash

#!/bin/sh
# Publishes the nkbmusic.com website staged in ~dev/nk-site to the Hestia web root.
# Run as dev: sudo sh ~/APPS/nanga_kathai/server/deploy-site.sh
set -e
SRC=/home/dev/nk-site
DEST=/home/user/web/nkbmusic.com/public_html
[ -f "$SRC/index.html" ] && [ -f "$SRC/config.js" ] || { echo "Nothing staged in $SRC"; exit 1; }
mkdir -p /home/dev/nk-site-backups
tar -czf "/home/dev/nk-site-backups/public_html-$(date +%Y%m%d-%H%M%S).tgz" -C "$DEST" .
rm -rf "${DEST:?}"/*
cp -a "$SRC"/. "$DEST"/
chown -R user:user "$DEST"
find "$DEST" -type d -exec chmod 755 {} +
find "$DEST" -type f -exec chmod 644 {} +
echo "Published to $DEST"