From a1e20e3c97eea0e3766c5c7a5bde6463a9a9cb0a Mon Sep 17 00:00:00 2001 From: Gopibabu Srungavarapu Date: Mon, 23 Oct 2023 22:04:58 -0400 Subject: [PATCH] updated deployment github action --- .scripts/deploy.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.scripts/deploy.sh b/.scripts/deploy.sh index 3f285fc..224dd20 100755 --- a/.scripts/deploy.sh +++ b/.scripts/deploy.sh @@ -2,11 +2,14 @@ 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 @@ -14,9 +17,9 @@ 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!"