DEVOPS

Promote Vercel Bundle Baseline on Main Merge

When a PR merges to main and its production deploy succeeds, captures the new per-route bundle sizes and promotes them to the stored production baseline used by PR budget gates.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerwebhook
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerVercel production deploy succeeded on mainVercelVercel
  • LogicConfirm production target and merge commit
  • ActionFetch final per-route bundle sizesVercelVercel
  • ActionUpsert sizes into baseline tablePostgreSQLPostgres
  • OutputComment baseline promotion on the commitGitHubGitHub

What it does

Keeps the bundle-size baseline honest. Every time main merges and the resulting production deploy succeeds, it records that build's per-route sizes as the new baseline, so future PR comparisons measure against what is actually live rather than a stale snapshot.

When to use it

Use it alongside a PR budget gate so the two stay in sync: the gate reads the baseline this flow writes. Run it whenever you want baseline promotion to be automatic and tied to real production deploys instead of a manual checked-in file.

How it works

  1. 1A Vercel production deployment-succeeded webhook fires, scoped to the main branch.
  2. 2A logic step confirms the deploy is the production target and corresponds to a merge commit.
  3. 3The flow fetches the final per-route bundle sizes from the Vercel build output.
  4. 4It upserts those sizes into the Postgres baseline table, replacing the prior values.
  5. 5It posts a short GitHub commit comment confirming the baseline was promoted, including total first-load JS for traceability.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect VercelDeploys, runtime logs, analytics.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Connect GitHubRepos, issues, pull requests, actions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.