I have just finished re-designing my website development environment to have all my source code in Github and have managed to set up Git on the remote server so that simply running the git pull origin master
command on the web server will update the entire application source code from the Github repository.
What I am trying to figure out now is a way to automate the process. The code pulled from the Master branch which always has the code ready for deployment and has already gone through testing. When I push the code to the Master branch I want to use one of Github hooks to automatically run the pull from the server to update the application.
I have SSH access to the server and am able to run the command manually each time I need to at the moment but it is time-consuming pushing code to Github, then opening an SSH connection to the server and pulling the updated code.
Not sure if there is a native feature within Git that supports this or if I would need to use a web hook and run a file on the web server to trigger the git pull origin master
command.
Thanks