A photograph of servers

Automated builds with Netlify and Kentico Cloud webhooks

Friday, February 15, 2019

One of the key aspects of developing a website using a static-site generator is understanding that the content is not served dynamically at the time of a request. In order to publish new content, the static website must be regenerated. An initial reaction could be that this is an arduous process that would require a developer or DevOps. However, this does not have to be the case.

This very website was developed using Gatsby and Kentico Cloud and is hosted by Netlify. In order to streamline content publishing, I configured Kentico Cloud to trigger a build which is automatically pushed live by Netlify - and this is how it was done.

Firstly, you need to log into your Netlify account and create a new Build Hook

A screenshot of the Netlify build hook form

Once you have created a build hook you will see a URL.

A screenshot of the Netlify build hook list

Your Netlify build hook is now created, time to configure Kentico Cloud to send a request to the URL and trigger the Netlify build. Log in to your Kentico Cloud account and navigate to Project Settings > Development > Webhooks.

A screenshot of the Kentico Cloud webhooks page

In this new window click the Create new Webhook button and enter a name and the URL from your Netlify build hook.

A screenshot of the Kentico Cloud webhook form

Finally, click save and you're ready to go. 

A screenshot of the Netlify deploys queue

Try publishing some new content on Kentico Cloud and check your Deploys queue in Netlify.

Kentico CloudNetlify