-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add worklow to preview documentation on PR
- Loading branch information
1 parent
b3eb040
commit 78f2626
Showing
3 changed files
with
66 additions
and
20 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,24 @@ | ||
Name: Build documentation | ||
description: Build the QUEENS documentation with sphinx | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create Python environment | ||
id: environment | ||
uses: ./.github/actions/create_python_environment | ||
- name: Sphinx build | ||
shell: bash -l {0} | ||
env: | ||
PYTHON_PACKAGE_MANAGER: ${{steps.environment.outputs.ppm}} | ||
run: | | ||
$PYTHON_PACKAGE_MANAGER activate queens | ||
sphinx-apidoc -o doc/source queens -f -M | ||
cd doc | ||
sphinx-build -b html -d build/doctrees source build/html | ||
- name: Upload html | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: doc/build/html | ||
retention-days: 1 |
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
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,38 @@ | ||
# yamllint disable | ||
name: preview_documentation | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
build-documentation: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build documentation | ||
uses: ./.github/actions/build_documentation | ||
|
||
deploy-preview: | ||
needs: build-documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: build | ||
deploy-repository: queens-doc-preview | ||
preview-branch: gh-pages | ||
umbrella-dir: docs/pr-preview | ||
pages-base-path: docs | ||
action: auto |