-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds publish of docs for non-main-branch
This way we can test it out/share
- Loading branch information
1 parent
d6f58f6
commit 9068921
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |