Skip to content

Commit

Permalink
DOC: Fix run twice in CI and local
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Mar 3, 2024
1 parent 0dc1615 commit 56f1814
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
doc-build:
name: Build documentation
runs-on: [self-hosted, Windows, pyaedt-examples]
env:
SPHINXBUILD_KEEP_DOCTREEDIR: "1"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -116,7 +118,6 @@ jobs:
# Use environment variable to keep the doctree and avoid redundant build for PDF pages
- name: Create HTML documentation
run: |
echo "SPHINXBUILD_KEEP_DOCTREEDIR=1" >> $GITHUB_ENV
.venv\Scripts\Activate.ps1
. .\doc\make.bat html
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def remove_doctree(app, exception):

# Keep the doctree to avoid creating it twice. This is typically helpful in CI/CD
# where we want to build both HTML and PDF pages.
if bool(os.getenv("SPHINXBUILD_KEEP_DOCTREEDIR", False)):
if bool(int(os.getenv("SPHINXBUILD_KEEP_DOCTREEDIR", "0"))):
logger.info(f"Keeping directory {app.doctreedir}.")
else:
size = directory_size(app.doctreedir)
Expand Down

0 comments on commit 56f1814

Please sign in to comment.