Web vitals automation using github actions
Google Core Web Vitals—Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS)—directly determine user experience, bounce rates, and search rankings. However, performance regressions often slip into production undetected when performance is only audited manually after release.
Automating Lighthouse in Continuous Integration: Integrating automated Lighthouse CI runs directly into your GitHub Actions workflow creates an automated quality gate for every pull request and preview deployment.
Configuring LHCI and assertion budgets: By setting up `.lighthouserc.json`, you can define strict assertion budgets—such as requiring a minimum performance score of 90, LCP under 2.5s, and zero layout shift. If a pull request introduces an unoptimized image bundle or blocking script that breaches these budgets, CI fails immediately.
Pairing with Vercel and Netlify preview URLs: The GitHub Action waits for the preview deployment URL to become ready, triggers multiple headless Chrome test runs against the live preview, averages the metric results, and posts a markdown summary comment directly on the pull request.
Cultivating a performance-first engineering culture: Automated CI checks remove subjectivity from performance discussions. Teams gain immediate visibility into the performance cost of new libraries and assets before merging to main.