Skip to content

feat: Add Lighthouse CI and performance optimizations#11

Merged
paveg merged 1 commit intomainfrom
feat/lighthouse-ci-and-performance
Jan 3, 2026
Merged

feat: Add Lighthouse CI and performance optimizations#11
paveg merged 1 commit intomainfrom
feat/lighthouse-ci-and-performance

Conversation

@paveg
Copy link
Owner

@paveg paveg commented Jan 3, 2026

Summary

  • Add Lighthouse CI to GitHub Actions for automated performance monitoring
  • Optimize font loading with async pattern to eliminate render-blocking
  • Split bundles for better caching (icons, utils separated)
  • Move SEO documentation to docs/ directory
  • Clean up unused test files and images

Performance Improvements

Metric Before After Change
Main bundle 231KB 204KB -12%
gzip size 73KB 65KB -8KB

Lighthouse CI Configuration

  • Core Web Vitals thresholds: LCP < 2.5s, CLS < 0.1
  • Category scores: Performance, Accessibility, Best Practices, SEO ≥ 90%
  • Reports uploaded to temporary public storage (7 days)

Test plan

  • Local Lighthouse CI run successful
  • Build passes with optimized chunks
  • CI pipeline runs Lighthouse job
  • Verify font loading is non-blocking

🤖 Generated with Claude Code

- Add Lighthouse CI to GitHub Actions workflow with performance assertions
- Optimize font loading with async pattern (non-blocking)
- Add DNS prefetch for external resources
- Split bundles: icons (lucide-react), utils (clsx, tailwind-merge, cva)
- Target ES2022 for smaller bundle output
- Move SEO docs to docs/ directory
- Remove unused test images
- Update .gitignore for Lighthouse CI output

Bundle size improvements:
- Main bundle: 231KB → 204KB (-12%)
- gzip: 73KB → 65KB (-8KB)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
devcard 88a14c4 Commit Preview URL

Branch Preview URL
Jan 03 2026, 07:35 AM

Comment on lines +49 to +81
runs-on: ubuntu-latest
needs: ci

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Lighthouse CI
run: npm install -g @lhci/cli@0.14.x

- name: Run Lighthouse CI
run: lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

- name: Upload Lighthouse report
uses: actions/upload-artifact@v4
if: always()
with:
name: lighthouse-report
path: .lighthouseci
retention-days: 7

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 months ago

In general, the fix is to declare an explicit permissions block in the workflow so that the GITHUB_TOKEN has only the minimal rights needed. For this CI workflow, both jobs only need to read the repository contents (for checkout) and do not need to write to the repo, issues, or pull requests. Artifact upload/download uses the workflow’s internal permissions and does not require repository write scopes. Therefore we can safely set contents: read at the workflow level, which will apply to both ci and lighthouse jobs.

The best fix with minimal functional change is to add a root-level permissions key after the name: CI line and before the on: block in .github/workflows/ci.yml:

  • Add:
    permissions:
      contents: read
    at the top level of the workflow.
  • No changes to the job steps are required.
  • No imports or additional methods are needed since this is purely a YAML configuration change.
Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,5 +1,8 @@
 name: CI
 
+permissions:
+  contents: read
+
 on:
   push:
     branches: [main]
EOF
@@ -1,5 +1,8 @@
name: CI

permissions:
contents: read

on:
push:
branches: [main]
Copilot is powered by AI and may make mistakes. Always verify output.
@paveg paveg merged commit 9ae0b73 into main Jan 3, 2026
6 checks passed
@paveg paveg deleted the feat/lighthouse-ci-and-performance branch January 3, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant