name: Publish Docs
on: workflow_dispatch

jobs:
  publish_docs:
    name: Publish docs to Netlify
    runs-on: ubuntu-latest
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v6

      - name: Setup | Node
        uses: actions/setup-node@v6
        with:
          node-version: 24.15.0
          cache: 'npm'
          cache-dependency-path: docs/package-lock.json

      - name: Setup | Install dependencies
        run: npm install
        working-directory: docs

      - name: Build | Build docs site
        run: npm run build
        working-directory: docs

      - name: Publish
        run: npx netlify-cli deploy --no-build --prod --dir=docs/.vitepress/dist
        env:
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
