#!/usr/bin/env bash # Build locally, push to the droplet, restart. Usage: deploy/deploy.sh set -euo pipefail HOST="${1:?usage: deploy.sh }" npm run build --workspace=@wizwar/web rsync -az --delete \ --exclude node_modules --exclude data/ --exclude .git --exclude research \ ./ "root@$HOST:/opt/wizwar/" ssh "root@$HOST" ' cd /opt/wizwar && npm install --no-audit --no-fund chown -R wizwar:wizwar /opt/wizwar cp /opt/wizwar/deploy/wizwar.service /etc/systemd/system/wizwar.service systemctl daemon-reload systemctl enable --now wizwar systemctl restart wizwar systemctl --no-pager -l status wizwar | head -5 ' echo "deployed."