name: docs

on:
  push:
    branches:
      - "main"
    paths:
      - "www/**/*"
      - ".github/workflows/docs.yml"
  pull_request:
    paths:
      - "www/**/*"
      - ".github/workflows/docs.yml"

permissions:
  contents: read

jobs:
  htmltest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3
      - uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
      - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
        with:
          go-version: stable
      - run: task docs:build
      - uses: wjdp/htmltest-action@09118714cd26bef56bd3d0819e4f9b1dce6f60a9 # master
        with:
          path: www/site
          config: www/htmltest.yml
