- Install PM2
npm install pm2 -g
- Add ssh configurations to Github account
- Clone the latest version repository (using ssh option
git clone ssh-path
) - Run in project's root path
pm2 deploy ecosystem.config.js production setup
- Create the environment pre-deploy - Run in project's root path
pm2 deploy ecosystem.config.js production
- Deploy a new version - If you want to validate that process is running well, you should run
pm2 ls
and if you need to see the logs registrypm2 log 0
(0 or pm2's process number)
Notes:
- setup option isn't necessary run in each deployment, is enough running production or the environment name that you have configured.