I am trying to host a Discord bot for my friends. We have a GitHub respository that we all have access to and push the code to. I am trying to do the following
- Once a push is detected, the server automatically runs
git pull
in the project folder so the new code from the GitHub is now in the project folder - To restart the bot, once a pull is detected run
pm2 restart 0
to restart the bot with the new code.
I am running Ubuntu 18.04 Server
Anybody have any suggestions on how to do this?