Skip to content

Skip redundant Vercel builds with an Ignored Build Step - #32

Merged
fielding merged 1 commit into
mainfrom
chore/vercel-ignore-build-step
Sep 7, 2026
Merged

Skip redundant Vercel builds with an Ignored Build Step#32
fielding merged 1 commit into
mainfrom
chore/vercel-ignore-build-step

Conversation

@fielding

@fielding fielding commented Sep 7, 2026

Copy link
Copy Markdown
Owner

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 of main/testnet, or when nothing under the package or the workspace manifests changed since VERCEL_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 reads vercel.json from 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):

case exit
preview of testnet on ripguard 0 skip
preview of main on ripguard-testnet 0 skip
PR branch, first deploy (no base) 1 build
prod main, app-sol, only EVM changed since base 0 skip
prod main, app, EVM changed since base 1 build
base SHA not in clone 1 build
no system env vars exposed 1 build
exact ignoreCommand run from inside packages/app-sol 0 skip

Live proof comes with the merge: the main merge should build ripguard + ripguard-sol and show ripguard-testnet's Preview as canceled by the Ignored Build Step; the testnet fast-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

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>
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ripguard Ready Ready Preview Sep 7, 2026 10:12pm UTC
ripguard-sol Ready Ready Preview Sep 7, 2026 10:12pm UTC
ripguard-testnet Ready Ready Preview Sep 7, 2026 10:12pm UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant