Skip to content

Commit

Permalink
Adds publish of docs for non-main-branch
Browse files Browse the repository at this point in the history
This way we can test it out/share
  • Loading branch information
elijahbenizzy committed Sep 22, 2024
1 parent d6f58f6 commit 9068921
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

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

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
- uses: actions/checkout@v3
- name: Install Python and Build Docs
if: github.event.action != 'closed' # Skip the build if the PR is closed
run: |
pip install -e ".[documentation]"
sphinx-build docs -b dirhtml _build
- name: Deploy preview
if: github.event.action != 'closed'
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./_build/html/ # This is where Sphinx outputs the built docs

- name: Cleanup preview
if: github.event.action == 'closed'
uses: rossjrw/pr-preview-action@v1
with:
action: delete # This removes the PR preview when the PR is closed

0 comments on commit 9068921

Please sign in to comment.