30 lines
563 B
Bash
30 lines
563 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
APP_ROOT="${APP_ROOT:-/var/www/studionoro}"
|
|
|
|
echo "==> Pull latest code (if using git)..."
|
|
cd "$APP_ROOT"
|
|
git pull || true
|
|
|
|
echo "==> Rebuild API..."
|
|
cd "$APP_ROOT/api"
|
|
npm ci --omit=dev || npm install --omit=dev
|
|
|
|
echo "==> Rebuild Nuxt..."
|
|
cd "$APP_ROOT/nuxt-tailwind-app"
|
|
npm ci || npm install
|
|
npm run build
|
|
|
|
echo "==> Rebuild admin..."
|
|
cd "$APP_ROOT/admin"
|
|
npm ci || npm install
|
|
npm run build
|
|
|
|
echo "==> Restart services..."
|
|
cd "$APP_ROOT"
|
|
pm2 restart ecosystem.config.cjs
|
|
systemctl reload nginx
|
|
|
|
echo "Deploy complete."
|