This project is configured with Lighthouse CI for automated performance, accessibility, and SEO audits.
Two GitHub Actions workflows are configured:
- Runs on every pull request and push to
main - Audits key pages of the site
- Provides automated feedback with performance scores
- Fails the build if thresholds are not met
- Comments on PRs with results
- Runs daily at 2 AM UTC
- Performs 3 runs per page and averages results
- Tracks performance trends over time
- Can be manually triggered via GitHub Actions
The audit configuration is in lighthouserc.json:
- Pages audited: Home, all major sections, blog
- Performance threshold: First Contentful Paint < 3s, LCP < 4s
- CLS threshold: < 0.1 (excellent stability)
- Preset:
lighthouse:recommended
# Install Node.js if not already installed
# macOS with Homebrew
brew install node# Build the site
deno task build
deno task optimize:build
# Serve the built site in the background
deno task serve &
SERVER_PID=$!
# Install Lighthouse CI globally
npm install -g @lhci/cli@^0.11.x
# Run Lighthouse audits
lhci autorun
# Stop the server
kill $SERVER_PIDCreate scripts/run-lighthouse.sh:
#!/bin/bash
set -e
echo "Building site..."
deno task build
deno task optimize:build
echo "Starting server..."
deno task serve &
SERVER_PID=$!
# Wait for server to start
sleep 5
echo "Running Lighthouse..."
npm install -g @lhci/cli@^0.11.x
lhci autorun
echo "Stopping server..."
kill $SERVER_PID
echo "Done! Check .lighthouseci/ for results"Lighthouse scores are color-coded:
- 🟢 90-100: Excellent
- 🟡 50-89: Needs improvement
- 🔴 0-49: Poor
Key metrics:
- Performance: Load speed and interactivity
- Accessibility: WCAG compliance and usability
- Best Practices: Security and modern standards
- SEO: Search engine optimization
- Go to the workflow run
- See the summary or download the
lighthouse-resultsartifact - Open
.lighthouseci/results/*.jsonfiles
Each result includes:
- Overall scores (0-100)
- Detailed audits and diagnostics
- Opportunities for improvement
- Passed/failed assertions
Common improvements:
- Optimize images and serve modern formats (WebP)
- Minimize JavaScript and CSS
- Use lazy loading for off-screen content
- Add proper ARIA labels and semantic HTML
- Improve Core Web Vitals (CLS, LCP, FID)
The GitHub Actions workflow:
- Checks out the code
- Sets up Deno v2
- Builds the site with
deno task build - Optimizes with Jampack (
deno task optimize:build) - Runs Lighthouse audits
- Comments on PRs with results (if applicable)
- Uploads artifacts for 30 days
- Fails the build if thresholds not met
Results not appearing in PR comments?
- Check that the workflow has write permissions (check permissions in workflow file)
- Verify
.lighthouseci/results/directory is created
Workflow fails to build?
- Ensure
deno.jsontasks are correct - Check that the build succeeds locally first
Port 3000 already in use?
- Change the port in
lighthouserc.jsonURLs anddeno.jsonserve task