How do I start an automatic deployment from Gitlab?

Last updated by Adam West on August 16, 2016 16:31

Each server or group has what is known as a "Deploy Hook"; this is a URL that you add to Gitlab as a webhook so Deploy is notified when new commits are pushed to your repository and can start automatic deployments.

Getting the "Deploy Hook" URL for a server

  1. Firstly navigate to the "Servers and Groups" page via the Settings on a given Project page:

    You can also access the page via the Servers box under a given project, inside the main Projects page:

  2. Next head to the edit page for the server:
  3. Find and make a note of he URL under the Automatic Deployment heading on the right hand side:

Adding a the "Deploy Hook" to GitHub

  1. Open your project up in Gitlab (there is a link to the top-left of the navigation for "Projects" in Gitlab), and navigate to it's Settings:

  2. Next navigate to Webhooks:
  3. Next just paste the URL from Deploy, and keep Push events checked, then click Add Webhook to save it.
  4. That's it! With this set up Deploy and Gitlab will now work together to automatically push changes to your server.

Please note, if you're adding a self hosted Gitlab repository, you'll need to make sure you select the repository host as Gitlab in your general settings first.