Skip to content

Commit

Permalink
fix duplicate pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
narenkram committed Oct 21, 2024
1 parent c027463 commit e878027
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ jobs:
else
echo "PM2 is already installed."
fi
echo "Stopping PM2 process..."
pm2 stop steadfast_api || true
echo "Running npm ci..."
npm ci --no-audit
echo "Starting PM2 process..."
pm2 start server.js --name steadfast_api
echo "Checking if PM2 process exists..."
if pm2 list | grep -q steadfast_api; then
echo "PM2 process exists. Restarting..."
pm2 restart steadfast_api
else
echo "PM2 process does not exist. Starting..."
pm2 start server.js --name steadfast_api
fi
echo "Deployment completed."
'

0 comments on commit e878027

Please sign in to comment.