⚠️ This lesson is retired and might contain outdated information.

Set Up a Deploy Webhook in Cloudflare Pages

Obinna Ekwuno
InstructorObinna Ekwuno
Share this video with your friends

Social Share Links

Send Tweet

In this lesson, you will set up a deploy webhook in Cloudflare Pages and then configure Contentful to trigger the hook on all events.

Instructor: [0:01] To create a deploy hook, we'll head over to Settings, and select Build and Deployments. If you scroll down, you can add a deploy hook. To set up with deploy hook for our Contentful sites, we would have to name the deploy hook, contentful-sites. The name can be anything you want, but just to keep the format, we will name it contentful-sites, and set it to trigger a build when changes are made to the main branch.

[0:33] Now, we would add that deploy hook and copy this, and head over to Contentful. In Contentful, you can get to the webhooks settings by going to Settings and then selecting Webhook. We can call this webhook, egghead-site-hook. Then we paste in our hook URL. You can also set this hook to trigger for certain events or trigger for all events. We'll leave the default settings as is, and then click Save.

[1:11] Now that we've set up this deploy hook, let's make a change to the content of the Cloudflare pages. Let's say, "Pages are awesome." If we publish this change and head over to Pages dashboard, we would see that this automatically triggers a build. When this build is over, if we click on the URL of the build, we can see that our change has been deployed.