GitHub – setup auto deployment with remote server

Currently, my production website is hosted on Azure. I use git and push all my commits to GitHub. With the magic of git hooks Azure has the ability to pull from GitHub when someone pushes a certain branch to GitHub.

How can I replicate this with my own staging server hosted on-premise? In other words, how can I set a repo on GitHub, and when I push to it, through git hooks send a signal, request or what-have-you to perform an automatic pull on my on-premise server?

  • What parameters are showing undefined in this dnvm.ps1 command? Deployment to Azure Web Site Fails as a result
  • Git Azure deployment missing files from content directory (MVC4 project)
  • Continuous deployment with Bitbucket on Azure not working
  • Remove Bitbucket deployment from Azure Web App
  • Build Bamboo from Bitbucket, Deploy to Azure Cloud
  • How do I access deployment history in Azure Web Apps?
  • I know Git is not a deployment software, but if I have to write a mechanism on my on-prmise server to make this happen I would like to know where to start. If it’s helpful, we use Microsoft technology, so we are running our staging server on Windows Server, while our production is on Azure.

    I understand that I’ll need to use callback url on my server to then perform whatever is needed.I would like to know what methods people use to accomplish this. e.g.: on my call back url, how would I call a script to run a pull/fetch/clone bash command. or other method.

    If you need more information, feel free to ask.

  • Problems with git submodules when submodules are private Github repos
  • Jenkins doesnt retrieve git references using git parameter plugin
  • How to tell git to ignore all further edit to a single file without removing it from the repo
  • Cannot see new files added to my git working directory
  • Why is git not pulling?
  • Git Subtree Merging reports conflict when merging a simple upstream change
  • One Solution collect form web for “GitHub – setup auto deployment with remote server”

    Expanding upon my comment,

    1. You would need to define/create a callback url on your end, which
      will need to be publicly accessible.

    2. github would make a hit to this url via a git hook whenever a
      push is made to the branch in question.

    3. You can add authentication for the hit in the hook, if needed.

    4. This call will inform your server that a push has been made to the
      certain branch on github.

    5. Now your server should start a deployment task which does the
      pull/clone.

    Regarding this deployment task, there are many ways to do this, and the finer details will vary depending on how you do it.

    One way would be to introduce a Continuous Integration tool like Jenkins in your stack, which you could also use for regular and test builds in different environments.

    Another way could be to execute a simple bash script which does cd $REPO_DIR && git pull origin branchname && service apache2 etc restart.

    Git Baby is a git and github fan, let's start git clone.