Quick question and maybe someone can offer some insight as to the best way to do this.
We are using Github for our development and working in such a way that the master branch is a mirror of what is on our development server. Once the dev server gets approved, we copy it onto production.
I was wondering, is there a way to make my server environment synched with the Github master and run so that if we do a master merge it will automatically be what is running on our development server? Is this possible without running git on the development server?
If not, what are other solutions that people have found to keep from having to copy files all over the place?
Thanks!
What people usually use for this are hooks, basically scripts that get executed on certain actions in your repository. The most appropriate hook for this situation would be a post-receive hook. It gets executed, after changes were pushed to your repository. You can then just update your other repository whenever the hook gets executed, and start your deployment whenever the master-branch was changed.
On GitHub, hooks are available in the admin section of your repository (“Service Hooks”). If you don’t have a specific system running, you can just use a WebHook, which essentially POSTs a custom URL with the information when the post-receive hook is executed. This allows you to put a public trigger script on your server that, when executed, starts the update and the deployment. To add security, you should check if the IP address is one of the ones listed on the GitHub page.