Skip to content

Commit

Permalink
Fix documentation deployment
Browse files Browse the repository at this point in the history
Documentation needs a working meshpy install to create the documentation

Therefore, move the documentation creation to a separate workflow
  • Loading branch information
davidrudlstorfer committed Jan 29, 2025
1 parent 94e5551 commit 850e872
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build documentation

on:
push:
branches:
- main

jobs:
build_documentation:
name: Build documentation
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup virtual python environment
uses: ./.github/actions/setup_virtual_python_environment
- name: Install dependencies
run: |
cd ${GITHUB_WORKSPACE}
source python-testing-environment/bin/activate
pip install -e .[CI-CD]
- name: Build API documentation
run: |
source python-testing-environment/bin/activate
pdoc --output-dir api-documentation meshpy/
- name: Upload API documentation artifact
uses: actions/upload-artifact@v4
with:
name: api-documentation
path: api-documentation/
18 changes: 6 additions & 12 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy website
on:
# Only build and deploy the website once the testsuite is completed => coverage badge and report are necessary
workflow_run:
workflows: [Test suite]
workflows: [Test suite, Build documentation]
types: [completed]
branches: [main]

Expand All @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: false

jobs:
build_website_and_documentation:
build_website:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -35,21 +35,13 @@ jobs:
with:
name: website
path: website/docs/build/
- name: Build API documentation
run: |
pdoc --output-dir api-documentation meshpy/
- name: Upload API documentation artifact
uses: actions/upload-artifact@v4
with:
name: api-documentation
path: api-documentation/

deploy:
environment:
name: Website
url: http://imcs-compsim.github.io/meshpy
runs-on: ubuntu-latest
needs: build_website_and_documentation
needs: build_website
permissions:
pages: write
id-token: write
Expand All @@ -61,10 +53,12 @@ jobs:
name: website
path: ${{ github.workspace }}
- name: Download API documentation artifact
uses: actions/download-artifact@v4
uses: dawidd6/action-download-artifact@v8
with:
workflow: documentation.yml
name: api-documentation
path: ${{ github.workspace }}/api-documentation
branch: ${{ github.event.repository.default_branch }}
- name: Download coverage report artifact
uses: dawidd6/action-download-artifact@v8
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ CI-CD = [
"coverage==7.4.4",
"coverage-badge",
"cubitpy@git+https://github.com/imcs-compsim/cubitpy.git@main",
"pdoc",
"setuptools", # Needed for coverage-badge
"testbook"
]
Expand Down
1 change: 0 additions & 1 deletion website/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
linkify-it-py
myst-parser
pdoc
pydata-sphinx-theme
sphinx

0 comments on commit 850e872

Please sign in to comment.