Lighthouse CI #1
This file contains 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 CI | |
on: | |
workflow_run: | |
workflows: ["Build and Deploy"] | |
types: | |
- completed | |
workflow_dispatch: # Allows manual triggering of the workflow | |
jobs: | |
lighthouse-on-live-site: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'master') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Audit root using Lighthouse | |
uses: treosh/lighthouse-ci-action@v12 | |
with: | |
urls: | | |
https://alpha.bloomlibrary.org | |
runs: 3 | |
budgetPath: ./.github/workflows/lighthouse-budget.json # test performance budgets | |
uploadArtifacts: true # save results as action artifacts | |
temporaryPublicStorage: true # upload lighthouse report to the temporary storage | |
# We have to run this separately with a separate budget file because the redirect causes | |
# lighthouse to think we are running at the root | |
- name: Audit /covid19 using Lighthouse | |
uses: treosh/lighthouse-ci-action@v12 | |
with: | |
urls: | | |
https://alpha.bloomlibrary.org/covid19 | |
runs: 3 | |
budgetPath: ./.github/workflows/lighthouse-budget-covid19-page.json # test performance budgets | |
uploadArtifacts: true # save results as action artifacts | |
temporaryPublicStorage: true # upload lighthouse report to the temporary storage | |
# This static directory test doesn't work (at least) because we don't build the site in the action. | |
# If we implemented it (and it worked...), it would have the advantage of immediate results instead | |
# of always being one deploy behind like the live site test. | |
# lighthouse-on-static-directory: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Audit URLs using Lighthouse | |
# uses: treosh/lighthouse-ci-action@v10 | |
# with: | |
# configPath: ./.github/workflows/lighthouserc.json | |
# runs: 3 | |
# budgetPath: ./.github/workflows/lighthouse-budget.json # test performance budgets | |
# uploadArtifacts: true # save results as action artifacts | |
# temporaryPublicStorage: true # upload lighthouse report to the temporary storage |