diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d35997a..d7a821a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -54,19 +54,30 @@ jobs: needs: deploy runs-on: ubuntu-latest + permissions: + contents: write + steps: - uses: actions/checkout@v4 - name: Use Node.js 20 uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci - - name: npm install, build - run: | - npm install - npm run build + - 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" + + - 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 79c1d87..de538b0 100644 --- a/lighthouserc.js +++ b/lighthouserc.js @@ -1,7 +1,10 @@ module.exports = { ci: { + collect: { + numberOfRuns: 3, + }, upload: { - target: "temporary-public-storage", + target: 'temporary-public-storage', }, }, };