From 90689213f676241d54419dd01564b2e1016e16bd Mon Sep 17 00:00:00 2001 From: elijahbenizzy Date: Sun, 22 Sep 2024 12:00:32 -0700 Subject: [PATCH] Adds publish of docs for non-main-branch This way we can test it out/share --- .github/workflows/docs-preview.yml | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docs-preview.yml diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml new file mode 100644 index 00000000..edda5088 --- /dev/null +++ b/.github/workflows/docs-preview.yml @@ -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