Skip to content

Commit

Permalink
updated deployment github action
Browse files Browse the repository at this point in the history
  • Loading branch information
gopibabu-tmhcc committed Oct 24, 2023
1 parent e464db1 commit a1e20e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

set -e

PM2_PATH=/root/.nvm/versions/node/v18.10.0/bin/pm2
NPM_PATH=/root/.nvm/versions/node/v18.10.0/bin/npm

echo "Deployment started ..."

# Enter maintenance mode or return true
# if already is in maintenance mode
(pm2 stop server.js --message 'The app is being (quickly!) updated. Please try again in a minute.') || true
($PM2_PATH stop server.js --message 'The app is being (quickly!) updated. Please try again in a minute.') || true

# Pull the latest version of the app
git fetch origin master
git reset --hard origin/master
git pull origin master

# Compile npm assets
npm install --omit=dev
$NPM_PATH install --omit=dev

# Exit maintenance mode
pm2 start server.js
$PM2_PATH start server.js

echo "Deployment finished!"

0 comments on commit a1e20e3

Please sign in to comment.