feat: Only deploy docs to production on release tags#1917
feat: Only deploy docs to production on release tags#1917
Conversation
Add Vercel Ignored Build Step script that allows preview deployments to proceed normally but only allows production deployments when the commit has a release tag (e.g., v1.0.0). This ensures the docs site matches the published release version. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds a Vercel Ignored Build Step script to control when documentation is deployed to production. The script ensures that production deployments only occur when a commit has been tagged with a release version (e.g., v1.0.0), while allowing preview deployments to proceed normally for all PRs.
Changes:
- Added bash script
docs/scripts/check-release-tag.shthat checks for release tags before allowing production builds - Script uses Vercel environment variables to distinguish between preview and production deployments
- Tag validation uses regex pattern matching to identify semantic version tags
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Check if any tag matches a version pattern | ||
| for TAG in $TAGS; do | ||
| if echo "$TAG" | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+'; then |
There was a problem hiding this comment.
The regex pattern will match prerelease version tags like "v1.0.0-beta" or "v0.0.0-z123abc" because it doesn't anchor at the end of the string. Based on the PR description stating "Production deployments only proceed when the commit has a release tag (e.g., v1.0.0)", it appears the intention is to match only stable release versions, not prereleases. Consider anchoring the pattern at the end with '$' or adding explicit exclusion of prerelease suffixes: '^v?[0-9]+.[0-9]+.[0-9]+$'
| if echo "$TAG" | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+'; then | |
| if echo "$TAG" | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+$'; then |
|
Preview build of published Zudoku package for commit fa907b8. See the deployment at: https://56855286.cosmocargo-public-package.pages.dev Note This is a preview of the Cosmo Cargo example using the Zudoku package published to a local registry to ensure it'll be working when published to the public NPM registry. Last updated: 2026-01-30T14:47:32.140Z |
Summary
v1.0.0)Setup Required
After merging, configure in Vercel dashboard:
bash scripts/check-release-tag.shTest plan
🤖 Generated with Claude Code