Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy Documentation Preview

# Per-PR docs preview. Each PR is built and published to gh-pages under
# pr-preview/pr-<N>/ and a link is posted as a PR comment; the preview is
# removed automatically when the PR is closed.
#
# Coexists with mike: mike only manages the version folders + versions.json,
# pr-preview-action only manages the pr-preview/ umbrella, so they don't clash.
#
# Note: uses the `pull_request` event, so previews only deploy for PRs from
# branches in this repo. Fork PRs get a read-only token and will skip the deploy.

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'Pipfile'
- '.github/workflows/docs-preview.yml'

concurrency: docs-preview-${{ github.event.pull_request.number }}

permissions:
contents: write
pull-requests: write

jobs:
deploy-preview:
runs-on: ubuntu-latest
# pr-preview-action still pins Node 20 nested actions (JamesIves/github-pages-deploy-action,
# marocchino/sticky-pull-request-comment). Opt them into Node 24 now to silence the deprecation
# warning; becomes a no-op once Node 24 is the runner default.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
steps:
- uses: actions/checkout@v6

- name: Set up Python
if: github.event.action != 'closed'
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install dependencies
if: github.event.action != 'closed'
run: pip install pipenv && pipenv install

- name: Build docs
if: github.event.action != 'closed'
run: pipenv run mkdocs build --site-dir site

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: site
umbrella-dir: pr-preview
Loading