@@ -16,23 +16,40 @@ inputs:
1616 required : false
1717 default : " mkdocs.yml"
1818 description : " Path to the mkdocs.yml file"
19+ PUBLISH_TO_PAGES :
20+ type : boolean
21+ required : false
22+ default : true
23+ description : " Whether to publish to GitHub Pages"
24+ CHECKOUT :
25+ type : boolean
26+ required : false
27+ default : true
28+ description : " Whether to perform repository checkout"
29+ PRE_BUILD_SCRIPT :
30+ type : string
31+ required : false
32+ description : " Path to the pre-build script"
33+ PRE_BUILD_SHELL :
34+ type : string
35+ required : false
36+ default : " bash"
37+ description : " Shell to use for running the pre-build script"
1938
2039runs :
2140 using : " composite"
2241 steps :
23- - uses : actions/checkout@v4
42+ - name : Checkout Repository
43+ if : ${{ inputs.CHECKOUT }}
44+ uses : actions/checkout@v4
2445 with :
2546 submodules : " recursive"
2647
2748 - name : Setup Pages
49+ if : ${{ inputs.PUBLISH_TO_PAGES }}
2850 id : pages
2951 uses : actions/configure-pages@v4
3052
31- - name : Setup Python
32- uses : actions/setup-python@v5
33- with :
34- python-version : 3.x
35-
3653 - name : Install MkDocs and Dependencies
3754 shell : bash
3855 run : |
@@ -42,21 +59,31 @@ runs:
4259 else
4360 pip install mkdocs-material==${{ inputs.MKDOCS_VERSION }}
4461 fi
45- if [ -f ${{ inputs.REQUIREMENTS }} ]; then
46- pip install -r ${{ inputs.REQUIREMENTS }}
62+ if [ -f "${{ inputs.REQUIREMENTS }}" ]; then
63+ pip install -r "${{ inputs.REQUIREMENTS }}"
64+ fi
65+
66+ - name : Run Pre-build Script
67+ if : ${{ inputs.PRE_BUILD_SCRIPT }}
68+ shell : ${{ inputs.PRE_BUILD_SHELL }}
69+ run : |
70+ if [ -f "${{ inputs.PRE_BUILD_SCRIPT }}" ]; then
71+ ${{ inputs.PRE_BUILD_SHELL }} "${{ inputs.PRE_BUILD_SCRIPT }}"
4772 fi
4873
4974 - name : Build MkDocs Site
5075 shell : bash
51- run : mkdocs build --config-file ${{ inputs.CONFIG_FILE }}
76+ run : mkdocs build --config-file " ${{ inputs.CONFIG_FILE }}"
5277
5378 - name : Upload pages artifact
79+ if : ${{ inputs.PUBLISH_TO_PAGES }}
5480 uses : actions/upload-pages-artifact@v3
5581 with :
5682 name : " github-pages"
5783 path : " ./site"
5884
5985 - name : Deploy to GitHub Pages
86+ if : ${{ inputs.PUBLISH_TO_PAGES }}
6087 id : deployment
6188 uses : actions/deploy-pages@v4
6289 with :
0 commit comments