Repository navigation
fix(theme-classic): show announcement bar on first load when id changes #10508
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lighthouse Report | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - docusaurus-v** | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lighthouse-report: | |
| permissions: | |
| pull-requests: write # for marocchino/sticky-pull-request-comment | |
| # ⚠️ No GitHub Actions cache on purpose, enforced by GitHub for every step | |
| # This job can write to pull requests | |
| # See https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#cache-mode | |
| cache-mode: none | |
| name: Lighthouse Report | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install pnpm | |
| uses: pnpm/setup@fa36a5ef7dcdefc3a7cb25655c122e00cf6e636e # v3.1.2 | |
| with: | |
| # Only install pnpm: Node.js and dependencies are installed by later steps | |
| install: false | |
| node-version-file: false | |
| - name: Use Node.js | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: lts/* | |
| check-latest: true | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile | |
| - name: Build website fast | |
| run: pnpm build:website:fast | |
| - name: Audit URLs using Lighthouse | |
| id: lighthouse_audit | |
| uses: treosh/lighthouse-ci-action@3e7e23fb74242897f95c0ba9cabad3d0227b9b18 # 12.6.2 | |
| with: | |
| urls: | | |
| http://localhost:3000 | |
| http://localhost:3000/docs/installation | |
| http://localhost:3000/docs/category/getting-started | |
| http://localhost:3000/blog | |
| http://localhost:3000/blog/preparing-your-site-for-docusaurus-v3 | |
| http://localhost:3000/blog/tags/release | |
| http://localhost:3000/blog/tags | |
| configPath: ./.github/workflows/lighthouserc.json | |
| uploadArtifacts: true | |
| temporaryPublicStorage: true | |
| - name: Format lighthouse score | |
| id: format_lighthouse_score | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const results = ${{ steps.lighthouse_audit.outputs.manifest }} | |
| const links = ${{ steps.lighthouse_audit.outputs.links }} | |
| const createLighthouseReport = (await import(`${process.env.GITHUB_WORKSPACE}/admin/scripts/formatLighthouseReport.js`)).default; | |
| const comment = createLighthouseReport({ results, links }); | |
| core.setOutput("comment", comment); | |
| - name: Add Lighthouse stats as comment | |
| id: comment_to_pr | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # 3.0.5 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| number: ${{ github.event.pull_request.number }} | |
| header: lighthouse | |
| message: ${{ steps.format_lighthouse_score.outputs.comment }} |