diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 00000000..6f6e6d9a --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,41 @@ +name: PR Preview Deploy + +on: + pull_request: + types: [opened, synchronize, reopened, closed] + +concurrency: + group: preview-${{ github.ref }} + cancel-in-progress: true + +jobs: + deploy-preview: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install mkdocs mkdocs-material mkdocs-video mkdocs-redirects + + - name: Build MkDocs site + if: github.event.action != 'closed' + run: mkdocs build + + - name: Deploy PR Preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./site/ + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto