· Performance · CI · Lighthouse
Lighthouse as a gatekeeper
A score I measure once by hand goes stale. Now every deploy measures again, and a slower site simply doesn't go live.
The page about how I built this site showed Lighthouse scores I had measured and copied over by hand. They were right on the day, but every new animation or image could quietly drag them down.
Now the GitHub Action builds the site, serves it locally with compression like the real host, and measures three times on mobile and three times on desktop. The median lands in a JSON file the page reads. If a score drops under budget, the deploy stops.
const BUDGET = {
mobile: { performance: 75, accessibility: 95, "best-practices": 95, seo: 95 },
desktop: { performance: 90, accessibility: 95, "best-practices": 95, seo: 95 },
};Why the median? The first run is often cold and scores lower. One outlier shouldn't block a deploy, a real regression should.