From a87d4d54b6c5e9ced02b4acc938cfcf2e3693d74 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:11:02 +0000 Subject: [PATCH 1/3] Initial plan From f7e63efa59ff6f31ed6885bd8330b892c4a4e82c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:15:23 +0000 Subject: [PATCH 2/3] Improve Lighthouse CI workflow with robust and secure practices Co-authored-by: theartcher <57297314+theartcher@users.noreply.github.com> --- .github/workflows/deploy.yml | 19 +++++++++++-------- lighthouserc.js | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d35997a..281d186 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -60,13 +60,16 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - - name: npm install, build - run: | - npm install - npm run build + - name: Install dependencies + run: npm ci + + - name: Build website + run: npm run build - - name: run Lighthouse CI - run: | - npm install -g @lhci/cli@0.15.x - lhci autorun + - name: Run Lighthouse CI + run: > + npx --yes @lhci/cli@0.15.x autorun + --collect.url="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" + --collect.settings.chromeFlags="--headless --no-sandbox --disable-gpu" diff --git a/lighthouserc.js b/lighthouserc.js index 79c1d87..687c4df 100644 --- a/lighthouserc.js +++ b/lighthouserc.js @@ -1,7 +1,23 @@ module.exports = { ci: { + collect: { + numberOfRuns: 3, + settings: { + // Additional Chrome flags can be passed via command line + // chromeFlags: '--headless --no-sandbox --disable-gpu' + }, + }, + assert: { + preset: 'lighthouse:recommended', + assertions: { + 'categories:performance': ['warn', { minScore: 0.9 }], + 'categories:accessibility': ['error', { minScore: 0.9 }], + 'categories:best-practices': ['warn', { minScore: 0.9 }], + 'categories:seo': ['warn', { minScore: 0.9 }], + }, + }, upload: { - target: "temporary-public-storage", + target: 'temporary-public-storage', }, }, }; From 72f908eeeacd89b25ac18cb1de723f98df3ff889 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 10:22:14 +0000 Subject: [PATCH 3/3] Remove assertions section and add Lighthouse badge generation Co-authored-by: theartcher <57297314+theartcher@users.noreply.github.com> --- .github/workflows/deploy.yml | 8 ++++++++ lighthouserc.js | 13 ------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 281d186..d7a821a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -54,6 +54,9 @@ jobs: needs: deploy runs-on: ubuntu-latest + permissions: + contents: write + steps: - uses: actions/checkout@v4 - name: Use Node.js 20 @@ -73,3 +76,8 @@ jobs: npx --yes @lhci/cli@0.15.x autorun --collect.url="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" --collect.settings.chromeFlags="--headless --no-sandbox --disable-gpu" + + - name: Generate Lighthouse Badges + uses: myactionway/lighthouse-badger-action@v2.2 + with: + urls: 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/' diff --git a/lighthouserc.js b/lighthouserc.js index 687c4df..de538b0 100644 --- a/lighthouserc.js +++ b/lighthouserc.js @@ -2,19 +2,6 @@ module.exports = { ci: { collect: { numberOfRuns: 3, - settings: { - // Additional Chrome flags can be passed via command line - // chromeFlags: '--headless --no-sandbox --disable-gpu' - }, - }, - assert: { - preset: 'lighthouse:recommended', - assertions: { - 'categories:performance': ['warn', { minScore: 0.9 }], - 'categories:accessibility': ['error', { minScore: 0.9 }], - 'categories:best-practices': ['warn', { minScore: 0.9 }], - 'categories:seo': ['warn', { minScore: 0.9 }], - }, }, upload: { target: 'temporary-public-storage',