23 lines
558 B
Bash
Executable File
23 lines
558 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
VPS="setia@ims.setia.com.my"
|
|
VPS_SSH_PORT=9321
|
|
REMOTE_DIR="/var/www/ims"
|
|
PORT=3003
|
|
|
|
echo "==> Building..."
|
|
npm run build
|
|
|
|
echo "==> Copying static assets into standalone..."
|
|
cp -r .next/static .next/standalone/.next/static
|
|
cp -r public .next/standalone/public
|
|
|
|
echo "==> Syncing to VPS..."
|
|
rsync -az --delete --exclude='.env' -e "ssh -p ${VPS_SSH_PORT}" .next/standalone/ "$VPS:$REMOTE_DIR/"
|
|
|
|
echo "==> Restarting service on VPS..."
|
|
ssh -p "${VPS_SSH_PORT}" "$VPS" "sudo systemctl restart ims"
|
|
|
|
echo "==> Done. https://ims.setia.com.my/"
|