10
10
slicer_ref :
11
11
description : " Slicer Branch or tag for which to build and publish the documentation"
12
12
default : main
13
+ preview :
14
+ description : " Publish at https://preview.apidocs.slicer.org"
15
+ default : false
16
+ type : boolean
13
17
14
18
permissions :
15
19
# Needed in the publish step to update gh-pages branch
@@ -26,12 +30,19 @@ jobs:
26
30
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
27
31
slicer_repository=${{ github.event.inputs.slicer_repository }}
28
32
slicer_ref=${{ github.event.inputs.slicer_ref }}
33
+ preview=${{ github.event.inputs.preview }}
34
+ echo "preview [$preview]"
29
35
else
30
36
echo "::error ::Unsupported EVENT_NAME [$EVENT_NAME]"
31
37
exit 1
32
38
fi
39
+ if [[ ! $preview =~ ^(false|true)$ ]]; then
40
+ echo "::error ::Invalid skip value 'preview'. Supported values are 'true' or 'false'"
41
+ exit 1
42
+ fi
33
43
echo "slicer_repository=$slicer_repository" >> $GITHUB_OUTPUT
34
44
echo "slicer_ref=$slicer_ref" >> $GITHUB_OUTPUT
45
+ echo "preview=$preview" >> $GITHUB_OUTPUT
35
46
env :
36
47
EVENT_NAME : ${{ github.event_name }}
37
48
@@ -172,6 +183,7 @@ jobs:
172
183
173
184
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174
185
with :
186
+ repository : Slicer/${{ toJSON(steps.collect_inputs.outputs.preview) && 'preview.apidocs.slicer.org' || 'apidocs.slicer.org' }}
175
187
ref : gh-pages
176
188
path : gh-pages
177
189
token : ${{ steps.app-token.outputs.token }}
@@ -208,7 +220,6 @@ jobs:
208
220
--publish-github-repo-branch gh-pages \
209
221
--publish-github-skip-auth
210
222
env :
211
- PUBLISH_GITHUB_PROJECT_NAME : apidocs.slicer.org
212
223
PUBLISH_GITHUB_USERNAME : ${{ steps.committer.outputs.committer-name }}
213
224
PUBLISH_GITHUB_USERMAIL : ${{ steps.committer.outputs.committer-email }}
214
225
SLICER_REPO_NAME : ${{ steps.collect_inputs.outputs.slicer_repository }}
0 commit comments