# Docusaurus site under documentation/ — same command as npm run docs:build.
name: Docs site build

on:
  pull_request:
    branches: [main]
    paths:
      - "documentation/**"
      - ".github/workflows/docs-ci.yml"
  push:
    branches: [main]
    paths:
      - "documentation/**"

permissions:
  contents: read

concurrency:
  group: docs-ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: [self-hosted, Linux, X64]
    env:
      FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v6
        with:
          node-version: "22"
          cache: npm
          cache-dependency-path: documentation/package-lock.json
      - name: Install and build Docusaurus
        working-directory: documentation
        run: |
          npm ci
          npm run build
