Skip to content

Conversation

@theartcher
Copy link
Contributor

Related issue #39

This PR proposes to add a workflow which generates a (public) lighthouse report.

@theartcher theartcher self-assigned this Dec 15, 2025
Copilot AI review requested due to automatic review settings December 15, 2025 09:45
@theartcher theartcher added the enhancement New feature or request label Dec 15, 2025
@theartcher theartcher merged commit b752719 into main Dec 15, 2025
1 check passed
@theartcher theartcher deleted the feature/39/lighthouse-reporting branch December 15, 2025 09:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Lighthouse CI integration to automatically generate public performance reports for the deployed GitHub Pages site. The workflow runs after successful deployment to audit the site's performance, accessibility, best practices, and SEO metrics.

Key Changes:

  • New lighthouserc.js configuration file for Lighthouse CI with temporary public storage
  • New lighthouse job in the deploy workflow that runs after site deployment

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lighthouserc.js Adds Lighthouse CI configuration with temporary public storage for report uploads
.github/workflows/deploy.yml Adds new lighthouse job that installs dependencies, builds the site, and runs Lighthouse CI audits after deployment

Comment on lines +64 to +72
- name: npm install, build
run: |
npm install
npm run build
- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.15.x
lhci autorun
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lighthouse job is rebuilding the site unnecessarily. Since this job runs after deployment (needs: deploy), it should test the deployed GitHub Pages URL directly rather than rebuilding locally. The lhci autorun command can be configured in lighthouserc.js to test the deployed URL, eliminating the need for these build steps.

Suggested change
- name: npm install, build
run: |
npm install
npm run build
- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.15.x
lhci autorun
# Removed unnecessary local build; test deployed site directly
- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.15.x
lhci autorun
env:
LHCI_BUILD_CONTEXT__CURRENT_BRANCH: ${{ github.ref_name }}
LHCI_BUILD_CONTEXT__CURRENT_HASH: ${{ github.sha }}
LHCI_BUILD_CONTEXT__CURRENT_URL: ${{ needs.deploy.outputs.page_url }}

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +6
module.exports = {
ci: {
upload: {
target: "temporary-public-storage",
},
},
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lighthouse configuration is missing a URL to test. The lighthouserc.js file needs a "collect" section that specifies the deployed GitHub Pages URL. Without this, lhci autorun won't know which URL to audit. Consider adding the deployed site URL from the deploy job's output.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants