#!/usr/bin/env bash # VerifyPack deploy — pull latest, install deps, rebuild frontend, restart services. # Run on the EC2 box (or invoked by GitHub Actions over SSH). set -euo pipefail APP_DIR="/mnt/data/verifypack" cd "$APP_DIR" echo "==> git pull" git fetch --all git reset --hard origin/main echo "==> backend deps" cd "$APP_DIR/backend" source .venv/bin/activate pip install -r requirements.txt >/dev/null deactivate echo "==> frontend build" cd "$APP_DIR/frontend" npm ci npm run build echo "==> restart services" sudo systemctl restart verifypack-backend sudo systemctl restart verifypack-frontend echo "==> health check" sleep 3 curl -fsS http://127.0.0.1:8000/health && echo echo "Deploy complete."