diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 9e00fc0..91a6394 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -46,7 +46,7 @@ jobs: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} run: | npm install -g @lhci/cli - lhci autorun --collect.settings.chromeFlags="--ignore-certificate-errors --no-sandbox --headless --disable-gpu"|| echo "Fail to Run Lighthouse CI!" + lhci autorun --collect.settings.chromeFlags="--ignore-certificate-errors --no-sandbox --headless --disable-gpu" || echo "Fail to Run Lighthouse CI!" - name: Format lighthouse score id: format_lighthouse_score @@ -55,7 +55,7 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} script: | const fs = require('fs'); - const results = JSON.parse(fs.readFileSync("./lhci_reports/manifest.json")); + const results = JSON.parse(fs.readFileSync("./.lighthouseci/manifest.json")); let comments = ""; results.forEach((result) => { const { summary, jsonPath } = result; diff --git a/lighthouserc.cjs b/lighthouserc.cjs index d216926..a2c8549 100644 --- a/lighthouserc.cjs +++ b/lighthouserc.cjs @@ -1,6 +1,7 @@ module.exports = { ci: { collect: { + staticDistDir: './build', numberOfRuns: 1, startServerCommand: 'npm run dev', url: ['https://localhost:3000'], @@ -9,7 +10,9 @@ module.exports = { // preset: 'lighthouse:recommended', // }, upload: { - target: 'temporary-public-storage', + target: 'filesystem', + outputDir: './lhci_reports', + reportFilenamePattern: '%%PATHNAME%%-%%DATETIME%%-report.%%EXTENSION%%', }, }, }