23 lines
637 B
Bash
Executable File
23 lines
637 B
Bash
Executable File
#!/bin/bash
|
|
# PeerCortex deploy script
|
|
# Usage: ./deploy/deploy.sh
|
|
# Requires: gh CLI logged in, SSH access to erik
|
|
|
|
set -e
|
|
REMOTE=erik
|
|
APP_DIR=/opt/peercortex-app
|
|
|
|
echo "[deploy] Pushing to GitHub..."
|
|
git push origin main
|
|
|
|
echo "[deploy] Pulling on ${REMOTE}..."
|
|
GH_TOKEN=$(gh auth token)
|
|
ssh ${REMOTE} "cd ${APP_DIR} && \
|
|
git remote set-url origin https://renefichtmueller:${GH_TOKEN}@github.com/renefichtmueller/PeerCortex.git && \
|
|
git pull origin main && \
|
|
git remote set-url origin https://github.com/renefichtmueller/PeerCortex.git && \
|
|
npm install --omit=dev --silent && \
|
|
pm2 restart peercortex"
|
|
|
|
echo "[deploy] Done."
|