#!/bin/bash set -e APP_DIR="/opt/build-a-squad" WEB_DIR="/var/www/html/build-a-squad" echo "==> Pulling latest code..." cd "$APP_DIR" git pull origin main echo "==> Installing dependencies..." npm install echo "==> Building..." npm run build echo "==> Deploying to $WEB_DIR..." sudo cp -r "$APP_DIR/dist/." "$WEB_DIR/" echo "==> Done. $(date)"