name: Publish docs

on:
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2
      - name: Use Node.js 22
        uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0
        with:
          node-version: '22'
          registry-url: 'https://registry.npmjs.org'

      - name: Install and Build 🔧
        run: |
          npm ci
          npm run docs:build

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6 #v4.4.1
        with:
          folder: docs # The folder the action should deploy.
