Skip redundant Vercel builds with an Ignored Build Step - #32
Merged
Conversation
Every push built all three Vercel projects, and each deployment branch also produced a Preview on the projects it is not production for (main -> ripguard-testnet preview, testnet -> ripguard + ripguard-sol previews). Nine deployments per PR cycle, three of them useful. Each carries a ~23 MB function bundle and Vercel keeps the last 20 production + 20 preview deployments per project regardless of retention policy, which is how three projects reached 3.3 GB of Functions Storage. scripts/vercel-ignore.sh, wired from packages/<app>/vercel.json (Vercel reads vercel.json from the Root Directory), exits 0 to skip when: - VERCEL_ENV is preview and the ref is main or testnet, or - nothing under the package or the workspace manifests changed since VERCEL_GIT_PREVIOUS_SHA, the last successful deployment of the branch. Not HEAD^: a testnet fast-forward lands several commits at once. Anything uncertain (no previous SHA, SHA outside the shallow clone, system env vars not exposed) builds. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Three Vercel projects were at 3.33 GB of Functions Storage. Cause: 160 retained deployments × a ~23 MB function bundle each. Every push built all three projects, and each deployment branch also produced a Preview on the projects it is not production for. Vercel keeps the last 20 production + 20 preview deployments per project regardless of retention policy, so deployment volume is the lever.
What
scripts/vercel-ignore.sh: Ignored Build Step. Exit 0 (skip) when the build is a Preview ofmain/testnet, or when nothing under the package or the workspace manifests changed sinceVERCEL_GIT_PREVIOUS_SHA(last successful deployment of the branch). Everything uncertain builds.packages/app/vercel.json,packages/app-sol/vercel.json: wire the script. Vercel readsvercel.jsonfrom the Root Directory, so the repo-root one does not apply to these projects.AGENTS.md: the sharp edge.Verification
Simulated locally against real SHAs (HEAD = #31 merge, base = #30 merge):
testneton ripguardmainon ripguard-testnetmain, app-sol, only EVM changed since basemain, app, EVM changed since baseignoreCommandrun from insidepackages/app-solLive proof comes with the merge: the
mainmerge should build ripguard + ripguard-sol and show ripguard-testnet's Preview as canceled by the Ignored Build Step; thetestnetfast-forward should build only ripguard-testnet.Also done today, outside this PR: deleted 25 stale Preview deployments that were not the live target of any alias or domain (160 → 134 retained).
🤖 Generated with Claude Code