-
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.
Add workflow to build and deploy the documentation to github pages (#86)
* docs: add workflow to build and deploy the documentation to github pages * docs: switch to deployment via action * docs: update conf.py * fix: Introduce action to create python environment * fix: remove unnecessary env
- Loading branch information
1 parent
9d1625f
commit e35ceae
Showing
5 changed files
with
103 additions
and
25 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: Create Python environment | ||
description: Create the QUEENS Python environment with all dependencies | ||
|
||
outputs: | ||
ppm: | ||
description: Python package manager | ||
value: ${{ steps.environment.outputs.ppm }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
- name: Create environment and install QUEENS | ||
id: environment | ||
shell: bash -l {0} | ||
env: | ||
PYTHON_PACKAGE_MANAGER: conda | ||
run: | | ||
$PYTHON_PACKAGE_MANAGER env create -f environment.yml | ||
$PYTHON_PACKAGE_MANAGER activate queens | ||
pip install -e .[develop] | ||
$PYTHON_PACKAGE_MANAGER env export > pipeline_conda_environment.yml | ||
$PYTHON_PACKAGE_MANAGER list | ||
echo "ppm=$PYTHON_PACKAGE_MANAGER" >> $GITHUB_OUTPUT |
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,50 @@ | ||
# yamllint disable | ||
name: documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build-documentation: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create Python environment | ||
id: environment | ||
uses: ./.github/actions/create_python_environment | ||
- name: Sphinx build | ||
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 | ||
|
||
deploy-documentation: | ||
needs: build-documentation | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
if: ${{github.ref == 'refs/heads/main'}} | ||
uses: actions/deploy-pages@v4 |
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
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