File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 push :
77 branches :
88 - main
9+ - dev
910 pull_request :
1011 branches :
1112 - main
@@ -24,17 +25,38 @@ jobs:
2425 runs-on : ubuntu-latest
2526 steps :
2627 - uses : actions/checkout@v4
28+ with :
29+ ref : main
30+ path : src-main
31+
32+ - uses : actions/checkout@v4
33+ with :
34+ ref : dev
35+ path : src-dev
36+
2737 - uses : actions/setup-python@v5
2838 with :
2939 python-version : " 3.12"
40+
3041 - run : pip install -r requirements.txt
31- - run : mkdocs build --strict
42+ working-directory : src-main
43+
44+ - name : Build production
45+ working-directory : src-main
46+ run : mkdocs build --strict -d "${GITHUB_WORKSPACE}/site"
47+
48+ - name : Build preview
49+ working-directory : src-dev
50+ env :
51+ MKDOCS_PREVIEW : " 1"
52+ run : mkdocs build --strict -d "${GITHUB_WORKSPACE}/site/preview"
53+
3254 - uses : actions/upload-pages-artifact@v3
3355 with :
3456 path : site
3557
3658 deploy :
37- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
59+ if : github.event_name == 'push' && ( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')
3860 needs : build
3961 runs-on : ubuntu-latest
4062 environment :
Original file line number Diff line number Diff line change 1+ import os
12import shutil
23from pathlib import Path
34
45
6+ def on_config (config , ** kwargs ):
7+ if os .environ .get ("MKDOCS_PREVIEW" ) == "1" :
8+ config .site_url = "https://sap-linuxlab.github.io/preview/"
9+ config .extra .pop ("analytics" , None )
10+ config .extra .pop ("consent" , None )
11+
12+
513def on_post_build (config , ** kwargs ):
614 src = Path (".well-known" )
715 if src .exists ():
You can’t perform that action at this time.
0 commit comments