Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 1.38 KB

a11y.md

File metadata and controls

19 lines (13 loc) · 1.38 KB

Accessibility (a11y)

Workflow: .github/workflows/a11y.yaml

Serves a built static site from an artifact and scans it with pa11y-ci. Its job reports as the pa11y check; called from a job named a11y, it appears as a11y / pa11y. It isn't Hugo-specific: any earlier job in the same run can upload the site.

Input Default Purpose
artifact required Artifact holding the built site
pa11y-config .pa11yci.js pa11y-ci config path
node-version 24 Node.js version for pa11y-ci
port 4173 Local port to serve the site on

The calling repo needs:

  • package.json and package-lock.json with pa11y-ci and serve as dev dependencies. The workflow runs them with npx --no-install, so their versions come from your lockfile.
  • A pa11y-ci config that scans the served site. The workflow sets SITE_URL (http://localhost:4173/ by default) for the pa11y-ci step, so read it with process.env.SITE_URL in a .pa11yci.js. Build the site with the same address as its base URL. Set chromeLaunchConfig.executablePath from the CHROME_PATH environment variable; the workflow points it at the runner's Chrome and skips Puppeteer's download.

For a full caller that builds a Hugo site and scans it, see the Hugo CI example.