name: PR Preview

on:
  pull_request:
    types: [opened, synchronize, reopened, closed]
    paths:
      - 'docs/**'

permissions:
  contents: write
  pull-requests: write

concurrency: preview-${{ github.ref }}

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Deploy PR Preview
        uses: rossjrw/pr-preview-action@v1
        with:
          source-dir: ./docs
          preview-branch: gh-pages
          umbrella-dir: pr-preview
          action: auto
