Skip to content

Commit 57a91d6

Browse files
committed
Add conditional doc build for branch environments
1 parent 1760560 commit 57a91d6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/docs.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ jobs:
137137
# Input: docs/ directory containing the Markdown files
138138
# Output: site/ directory containing the generated HTML files
139139
- name: Build site with MkDocs
140-
run: pixi run docs-build
140+
run: |
141+
if [[ "${CI_BRANCH}" == "develop" || "${CI_BRANCH}" == "master" || "${CI_BRANCH}" == "main" ]]; then
142+
echo "📘 Building production docs for ${CI_BRANCH}"
143+
pixi run docs-build
144+
else
145+
echo "📗 Building local docs for ${CI_BRANCH}"
146+
pixi run docs-local
147+
fi
141148
142149
# Set up the Pages action to configure the static files to be deployed
143150
# NOTE: The repository must have GitHub Pages enabled and configured to build using GitHub Actions

pixi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ docs-notebooks = 'mv tutorials/*.ipynb docs/tutorials/'
177177
docs-config = 'python tools/create_mkdocs_yml.py'
178178
docs-serve = "JUPYTER_PLATFORM_DIRS=1 PYTHONWARNINGS='ignore::RuntimeWarning' python -m mkdocs serve --dirty"
179179
docs-build = "JUPYTER_PLATFORM_DIRS=1 PYTHONWARNINGS='ignore::RuntimeWarning' python -m mkdocs build"
180+
docs-local = "pixi run docs-build --no-directory-urls"
180181
docs-clean = 'tools/cleanup_docs.sh'
181182
docs-setup = { depends-on = [
182183
'docs-config',

0 commit comments

Comments
 (0)