Skip to content
lighthouse
Menu

How it works

How it works

Onboarding a repo has three steps: Registration, wiring lighthouserc.js and adding the CI upload step. The server only has to be deployed once.

  1. Step 1

    Deploy the server

    Run apps/server as a container with a Postgres database and set LHCI_DATABASE_URL and the server basicAuth pair, LHCI_BASIC_AUTH_USERNAME and LHCI_BASIC_AUTH_PASSWORD.

  2. Step 2

    Register the repo

    lhci-toolkit register <name> creates a Project and prints its id, its Build token and its Admin token. Registration itself needs the server basicAuth pair.

  3. Step 3

    Wire lighthouserc.js

    Point upload at your server with target lhci, the Build token and upload.basicAuth. Without basicAuth the upload fails with 401, even with a valid token.

  4. Step 4

    Add the CI step

    Run npx @lhci/cli autorun with LHCI_BUILD_TOKEN, LHCI_BASIC_AUTH_USERNAME and LHCI_BASIC_AUTH_PASSWORD. Add GITHUB_TOKEN and Lighthouse CI posts its score on the pull request.

  5. Step 5

    Compare builds

    Each upload becomes a Build for that commit. The dashboard compares it against the Project’s base branch.

  6. Step 6

    Audit the live site too

    To audit a deployed URL as well, register a second Project named <repo>-live with its own no-build workflow. The server keeps one Build per Project and commit, so the two paths need separate Projects.

Keep your score history in one place you own

Deploy the server once, then onboard each repo in a few minutes.