My college provides us with some space on a high performance server ( Massive RAM and GPU ); well I am planning to deploy my telegram bot on it. The creative part would be to somehow remotely update the code once deployed. I thought I would write a time dependent script that would fetch merge a specific branch of my github repo and restart the python bot server. Is there a better way of doing this?
Use github webhooks. They ping an address / url with specific updates you want it to listen for. On the server side you have a simple server listening which validates the ping to make sure it's coming from github, and if valid, you use the payload in whichever way necessary.
For instance, if the ping is simply to tell your server that the repo branch was updated, then that would just trigger your server to perform a git pull on that branch.
Matt Strom
Software Engineer, TypeScript ninja
What about using a CI/CD server? The build server can be configured to build and deploy a new release when a commit to a certain branch occurs or when a branch is tagged.
If your project is open source, you can use Travis for free. If your project is not open source, then Visual Studio Team Services offers a free tier with a Git repository and CI/CD service.