diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index 4ec1843..76360b0 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -58,13 +58,17 @@ jobs: # Build pnpm build + # Start second instance + pm2 start apps/server/ecosystem.config.js --only harmony-api2 --env production + + sleep 5 + # Restart first instance - pm2 restart harmony-api --env production || pm2 start apps/server/ecosystem.config.js --env production + pm2 restart apps/server/ecosystem.config.js --env production || pm2 start apps/server/ecosystem.config.js --env production - # Wait for server to start sleep 5 - # Restart second instance - pm2 restart harmony-api2 --env production || pm2 start apps/server/ecosystem.config.js --env production + # Stop second instance + pm2 stop harmony-api2 echo "Deployment Success"