You push a feature, all green, but a week later LCP on mobile jumps from 2.5s to 6s. Regression slipped into production — sounds familiar? We've seen this dozens of times. The fix is running Lighthouse CI automatically on every deploy. You catch metric drops in CI, not in production, and know exactly which commit caused the degradation. Our track record: over 50 successful integrations, saving clients thousands in manual audits. Typical setup investment: $1,500-$3,000 depending on complexity, with monthly savings of up to $800 in manual audit costs. With 5+ years of web performance expertise, we deliver proven results. Our automated Lighthouse CI runs on every CI/CD deploy, ensuring Core Web Vitals metrics like LCP and CLS remain within thresholds.
Automation detects regressions 3× faster than manual checks and eliminates human error. Instead of weekly audits, every change is validated with build blocking when thresholds are breached. Time to identify a problem drops from 2 days to 2 hours. The Lighthouse CI documentation recommends this approach for maintaining Core Web Vitals.
How to Set Up Automated Lighthouse Runs on Deploy
Minimal stack: CI/CD (GitHub Actions, GitLab CI) + Lighthouse CI CLI + storage for results. We use a self-hosted LHCI server for history and baseline comparisons. Configuration is defined in .lighthouserc.js.
module.exports = {
ci: {
collect: {
url: [
'http://localhost:3000/',
'http://localhost:3000/about',
'http://localhost:3000/catalog',
'http://localhost:3000/product/test-product',
],
numberOfRuns: 3,
startServerCommand: 'npm run start:ci',
startServerReadyPattern: 'ready on',
startServerReadyTimeout: 30000,
},
assert: {
assertions: {
'categories:performance': ['warn', { minScore: 0.8 }],
'categories:accessibility': ['error', { minScore: 0.9 }],
'categories:best-practices': ['warn', { minScore: 0.85 }],
'categories:seo': ['error', { minScore: 0.9 }],
'first-contentful-paint': ['warn', { maxNumericValue: 2000 }],
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
'total-blocking-time': ['warn', { maxNumericValue: 300 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'speed-index': ['warn', { maxNumericValue: 3400 }],
},
},
upload: {
target: 'temporary-public-storage',
},
},
};
GitHub Actions workflow:
name: Lighthouse CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run Lighthouse CI
run: |
npm install -g @lhci/[email protected]
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
What Automation Provides
Automation turns Lighthouse from a one-off check into a continuous process. Comparison table:
| Criteria | Manual Run | Automated CI |
|---|---|---|
| Frequency | Weekly/monthly | Every deploy |
| Regression detection | Post-factum | At CI stage |
| Commit attribution | No | Exact |
| Historical trends | No | Available |
A self-hosted LHCI server offers history and baseline comparisons.
Why Choose a Self-Hosted LHCI Server?
A self-hosted server keeps reports in your infrastructure, allows PR comparison against the main branch, and shows trends. No dependency on external services — all data under your control. Additionally, you can set up alerts when Core Web Vitals drop below thresholds.
Critical Metrics for E-commerce
For an online store, the key metrics are Largest Contentful Paint (LCP) ≤ 2.5 s, Cumulative Layout Shift (CLS) ≤ 0.1, and Total Blocking Time (TBT) ≤ 200 ms. Automated Lighthouse CI validates them on every deploy, ensuring changes don't degrade user experience. For instance, after adding a new banner, LCP increased by 0.5 s — CI blocked the build, and the fix was deployed before reaching production. With this monitoring, 95% of regressions are caught within 10 minutes.
Our Work Process
- Analysis — identify key pages and metric thresholds (e.g., product page, catalog, homepage for a marketplace).
- Design — choose the stack (GitHub Actions, GitLab CI, self-hosted) and storage architecture.
- Implementation — configure
.lighthouserc.js, CI workflow, add Slack or Telegram notifications. - Testing — run on PRs, adjust thresholds, eliminate false positives.
- Documentation and training — hand over config files, write team instructions, and set up a dashboard.
Degradation Notifications
LHCI doesn't send Slack alerts natively, so we add a CI step:
- name: Check Lighthouse results and notify
if: always()
run: |
RESULT=$(cat .lighthouseci/manifest.json | jq -r '.[0].summary.performance')
SCORE=$(echo "$RESULT * 100" | bc | cut -d. -f1)
if [ "$SCORE" -lt "80" ]; then
curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
-H 'Content-Type: application/json' \
-d "{\"text\": \":warning: Lighthouse Performance score dropped to ${SCORE}/100 on \`${{ github.ref_name }}\"",\"attachments\": [{\"color\": \"danger\",\"text\": \"Commit: ${{ github.sha }}\
Actor: ${{ github.actor }}\"}]}"
fi
Common Setup Issues
| Problem | Solution |
|---|---|
| Build doesn't start due to port conflict | Ensure startServerCommand starts the app on localhost:3000 |
| False positives from metric fluctuation | Increase numberOfRuns to 3 and use median |
| Insufficient storage for reports | Set a lifecycle policy to delete old reports or use a self-hosted server |
Checking Specific Audits
Beyond category scores, we configure checks for individual audits like render-blocking-resources, unsized-images, and prioritize-lcp-image. This gives more precise control than an overall score.
Timeline and Deliverables
Basic setup in GitHub Actions with temporary storage takes 2–4 hours. With a self-hosted server and notifications, expect 1–2 business days. A full system with history, comparisons, and review integration takes 3–5 business days.
- Lighthouse CI configuration tailored to your repository.
- Self-hosted LHCI server deployment (if history is needed).
- Slack/Telegram integration for alerts.
- Thresholds for all Core Web Vitals metrics.
- Documentation and team training.
Our team has been working on Web Performance for over 5 years and has completed 50+ Lighthouse CI integrations for projects ranging from landing pages to marketplaces. We guarantee transparency: you get full access to configs and change history.
Get a turnkey solution. Contact us for a free project estimate. The package includes full configuration, documentation, and 30-day support. Request a Lighthouse CI setup — it takes from 2 hours. Benefit from architecture consultation and save up to 3 hours per week (approximately $200/week in developer time).







