Skip to content

ci(docs): build on Vercel only for docs changes and releases - #489

Merged
antfu merged 2 commits into
mainfrom
skip-vercel-non-docs-release-commits
Nov 10, 2026
Merged

antfu merged 2 commits into
mainfrom
skip-vercel-non-docs-release-commits

Conversation

@antfubot

@antfubot antfubot commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The docs site on Vercel was rebuilt on almost every push. The old ignoreCommand (git diff --quiet HEAD^ HEAD -- ':!content') skipped a build only when a commit changed nothing outside docs/content. Code-only commits like fix(hub-ui): ... still started a docs build.

Now Vercel builds only when one of these is true:

  • The commit changes docs/, pnpm-workspace.yaml or pnpm-lock.yaml. The docs use devframe and plugins from the workspace and versions from the pnpm catalogs, so dependency changes can break the docs build.
  • The first line of the commit message starts with chore: release v, which is the commit that bumpp makes. A release changes no file under docs/, but the site should still deploy.

All other commits skip the build.

Vercel runs ignoreCommand in docs/ before each build. Exit 0 skips the build. Any other exit code runs it. git diff --quiet exits 1 when the listed paths changed. The :/ pathspecs are resolved from the repo root. If HEAD^ is missing from the clone, git diff exits 128 and Vercel builds.

Boundaries and risks

Case Effect
PR preview deploys Only the latest push (HEAD^..HEAD) is checked, not the whole PR. A push that changes only code skips the preview, even if earlier pushes changed docs.
A code change that breaks the docs build without touching docs/ or the pnpm files Not caught until the next docs change or release.
Manual redeploy in the Vercel dashboard Not checked. Based on Vercel docs, I expect the ignore step does not block it.

User prompts

Opus 5.5 in Claude Code (Paseo). The user asked: "make Vercel skip non-docs/release commits". My first version checked only commit messages. The user asked whether it should check the files instead. We picked a hybrid: changed files, plus the release commit message.

Verification

I ran the exact command from docs/vercel.json with sh from docs/ in a scratch git repo:

0 <- fix touching packages/                  skip
1 <- feat touching docs/content              build
1 <- deps touching lockfile                  build
1 <- release touching packages/              build
0 <- "chore: release v9" only in the body    skip
128 <- no parent commit (HEAD^ missing)      build

pnpm exec eslint docs/vercel.json passes. I did not test this on Vercel. The first deploy after merge shows if it works.


Written by an AI agent (Claude). The user gave the task and picked the build rule. They have not reviewed the diff yet.

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
devframe Ready Ready Preview Nov 10, 2026 7:14am UTC

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/489?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-10 07:13 UTC
🔗 head 89abcdb
🤖 automated by pulls.review

{
  "headSha": "89abcdb0174e2d10c1ae49f3713e068c56deecc3",
  "result": {
    "overallSummary": "Reduces unnecessary Vercel docs builds by changing the `ignoreCommand` to only trigger a build when docs-related files (or workspace/lockfile dependencies that affect the docs build) change, or when the commit is a release commit made by `bumpp`.",
    "groups": [
      {
        "key": "vercel-ignore-command",
        "label": "Vercel ignoreCommand update",
        "summary": "Updates the Vercel `ignoreCommand` so docs builds only trigger on changes under `docs/`, `pnpm-workspace.yaml`, or `pnpm-lock.yaml`, or on release commits (`chore: release v...`), instead of building on nearly every push.",
        "category": "config",
        "filePaths": [
          "docs/vercel.json"
        ],
        "critical": true,
        "lineNotes": [
          {
            "path": "docs/vercel.json",
            "side": "additions",
            "line": 6,
            "text": "Note the boundaries: this only checks the latest push's diff (`HEAD^ HEAD`), not the whole PR range, and relies on `HEAD^` existing in the shallow clone (exit 128 otherwise falls back to building)."
          }
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-10T07:13:25.989Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@antfubot antfubot changed the title ci(docs): build on Vercel only for docs and release commits ci(docs): build on Vercel only for docs changes and releases Nov 10, 2026
@antfu
antfu merged commit 21fa576 into main Nov 10, 2026
14 of 16 checks passed
@antfu
antfu deleted the skip-vercel-non-docs-release-commits branch November 10, 2026 07:13

This branch was successfully deployed

1 active deployment
Preview — 89abcdb0 Deployed Nov 10, 2026 by vercel[bot]
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.

2 participants