
Automatic Builds for Sanity
Webhooks are fun
Today, I created a webhook for my Sanity project, and I am consuming the webhook in Vercel and GitHub to automatically rebuild once I update or create content through the Sanity dashboard. It was relatively easy to set up. The reason why I decided to go this route was because I am leveraging Static Site Generation (SSG) for better loading speed and performance for pages. Calling the Sanity CDN with an Axios call and storing it in a Svelte Store was not giving me the performance that I desired. I plan on migrating from Vercel to AWS CloudFormation in the future, so I wanted to prepare for that as well.
See below for the Sanity docs on how to create the webhook.