name: Test Deploy to GitHub Pages

on:
  pull_request:
    branches:
      - main
    paths:
      - 'docs/*'

jobs:
  test-deploy:
    name: Test deployment of docs website
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          path: 'repo'
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: npm
          cache-dependency-path: ./repo/docs/package-lock.json

      - name: Install dependencies
        run: npm install --frozen-lockfile
        working-directory: ./repo/docs
      - name: Test build website
        run: npm run build
        working-directory: ./repo/docs
