In this guide, we'll walk through how to set up automatic rebuilds on Vercel whenever a blog post is updated in MicroCMS. This can help keep your site up to date without manually triggering deployments.
Steps:
1. Create a Vercel Deploy Hook
Go to your project in Vercel and navigate to Settings.
Under the Git section, find Deploy Hooks.
Click Create Hook and provide a Hook Name and select the Branch you want to trigger the rebuild from.
Once the hook is created, Vercel will generate a Deploy Hook URL. Copy this URL for the next step.
2. Set Up a Webhook in MicroCMS
Open the MicroCMS dashboard and select the API that manages your blog or content.
On the left sidebar, navigate to Webhook settings.
Click Add Webhook and select the event types (e.g., "create", "update") that you want to trigger a rebuild.
Paste the Deploy Hook URL from Vercel into the URL field.
Save the Webhook settings.
3. Test the Setup
Now, when you update or create a blog post in MicroCMS, Vercel should automatically start rebuilding your site.
Check the Vercel dashboard to ensure the rebuild is triggered and the latest content is reflected on your site.
With this setup, you can automate the process of rebuilding your Vercel app whenever your MicroCMS content is updated, saving time and ensuring your content is always up to date.