惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
M
MIT News - Artificial intelligence
D
Docker
S
SegmentFault 最新的问题
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
C
Check Point Blog
GbyAI
GbyAI
美团技术团队
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog

Vercel News

Vercel Open Source Program: Winter 2026 cohort How Notion Workers run untrusted code at scale with Vercel Sandbox How we run Vercel's CDN in front of Discourse From idea to secure checkout in minutes with Stripe Building Slack agents can be easy Scaling redirects to infinity on Vercel Advancing Python typing Gamma builds design-first agents with Vercel How Avalara turns pipe dreams into patent-pending with v0 Keeping community human while scaling with agents How OpenEvidence built a healthcare AI that physicians actually trust Security boundaries in agentic architectures Skills Night: 69,000+ ways agents are getting smarter Video Generation with AI Gateway We Ralph Wiggumed WebStreams to make them 10x faster How Stably ships AI testing agents in hours, not weeks How we built AEO tracking for coding agents Anyone can build agents, but it takes a platform to run them Introducing Geist Pixel The Vercel AI Accelerator is back with $6m in credits Making agent-friendly pages with content negotiation The Vercel OSS Bug Bounty program is now available Introducing the new v0 Run untrusted code with Vercel Sandbox, now generally available How Stripe built a game-changing app in a single flight with v0 How Sensay went from zero to product in six weeks AGENTS.md outperforms skills in our agent evals Agent skills explained: An FAQ Testing if "bash is all you need" AWS databases are now live on the Vercel Marketplace and v0
Trigger a Vercel deployment from any event using Deploy H...
2019-07-30 · via Vercel News

2 min read

Trigger new deployments using any external event.

Thanks to our first-class GitHub and GitLab Integrations, you can simply push your code to deploy with Vercel. But what if you wanted to create a deployment not based on change of source code, but another external event, such as an update in CMS content?

Starting today, you can deploy based on any event with Deploy Hooks.

An illustration of a Vercel Deploy Hook set on Contentful. The Deploy Hook ensures a build and deployment each time content is updated.

An illustration of a Vercel Deploy Hook set on Contentful. The Deploy Hook ensures a build and deployment each time content is updated.

Link to headingWhat is a Deploy Hook?

A Deploy Hook is a URL that accepts POST requests to trigger deployments with Vercel.

Any platform that can make POST requests can trigger Deploy Hooks — this includes third-party services such as headless CMSes, cron utilities, and even your command line.

Link to headingStatic Example: Gatsby + Contentful

In order to illustrate Deploy Hooks, we consider the popular pairing of a Gatsby-powered static site, backed by content on Contentful. Let's set it up so that the static site automatically builds and deploys each time content is updated.

1. Set up Boilerplate

Luckily for us, the Contentful community already has a Gatsby + Contentful boilerplate available.

gatsby new contentful-starter https://github.com/contentful-userland/gatsby-contentful-starter

The boilerplate is a beautiful and fast blog demo powered by Gatsby and Contentful.

2. Sign up for Contentful and Obtain Tokens

Once signed up, we run the setup script highlighted on Contentful's onboarding page.

`npm run setup` takes care of setting up the environment variables that Gatsby needs from Contentful.

`npm run setup` takes care of setting up the environment variables that Gatsby needs from Contentful.

Next, we set the CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN environment variables.

4. Create Deploy Hook and Specify on Contentful

We want our Gatsby site to re-build and deploy whenever there is an update in Contentful. Therefore, we create a Deploy Hook pointing to the git master branch, and specify the Deploy Hook as a webhook within Contentful.

It's easy to create a Deploy Hook for any Vercel project — the docs visually explain how.

Once the webhook is created, our setup is complete.

Once the webhook is created, our setup is complete.

Link to headingTrying it Out!

When we update content via Contentful, a new static Gatsby build is created. After a brief wait, our site is deployed and the updated content is live for us to see!

Link to headingReliability and Robustness

In order to create a robust system, we have kept several checks in place:

  • Automatically debounced builds. You can POST to the Deploy Hook multiple times, and our systems will intelligently discard duplicate deployments.

  • Straightforward revoking. If you suspect that you may have accidentally leaked your Deploy Hook, you can easily swap the existing hook for a new one within your project settings.

  • Clear timeline of deployment activity. Under the Events tab, you can clearly identify deployments created via hooks.

The Events timeline clearly showcases all the deployments, including their sources.

The Events timeline clearly showcases all the deployments, including their sources.

Link to headingConclusion

With Deploy Hooks, you can now deploy based on any event.

In this post, we explored how Deploy Hooks can help you automatically re-build and deploy a static site based on content updates.

How do you intend on using Deploy Hooks? Let us know via Twitter or Chat!