Run a simple pipeline after every git commit and restart the process using pm2.
cd /var/www
or you default webistes folder
git clone git@github.com:mattiaz9/tienode.git
cd tienode
(pnpm|npm|yarn) install
(pnpm|npm|yarn) build
- Rename
.env.example
in.env
- Change
POLL_INTERVAL
,GITHUB_TOKEN
,GITHUB_ALLOW_DEPLOYMENTS
andGITHUB_ALLOW_COMMENTS
as you wish - I suggest using a fake collaborator account for comments to get an email notifications
- Rename
config/projects.js.example
inconfig/projects.js
- Add all your projects configurations as shown in the example
- Make sure each project names are different from each others
cp config/ecosystem.config.js ../ecosystem.config.js
cd ..
If you haven't installed pm2 yet:
sudo npm install -g pm2
pm2 start ecosystem.config.js
pm2 save
pm2 startup
cd /var/www
pm2 restart ecosystem.config.js