Reputation: 144
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
git pull
in the project folder so the new code from the GitHub is now in the project folderpm2 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?
Upvotes: 1
Views: 1880
Reputation: 4862
You're looking for github webhooks. You'll likely need to set up a web server on that Ubuntu box that github can ping when certain events are triggered in your repo.
The server can then verify that the request came from github (see securing your webhooks), and run some script (this can be a basic bash script) that performs your site maintenance (backup, pull, redeploy, etc.).
Upvotes: 2