Skip to content

Commit 441f764

Browse files
committed
feat: Support publishing at preview.apidocs.slicer.org
1 parent a4ef7cd commit 441f764

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/doxygen-build-and-publish.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
slicer_ref:
1111
description: "Slicer Branch or tag for which to build and publish the documentation"
1212
default: main
13+
preview:
14+
description: "Publish at https://preview.apidocs.slicer.org"
15+
default: false
16+
type: boolean
1317

1418
permissions:
1519
# Needed in the publish step to update gh-pages branch
@@ -26,12 +30,19 @@ jobs:
2630
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
2731
slicer_repository=${{ github.event.inputs.slicer_repository }}
2832
slicer_ref=${{ github.event.inputs.slicer_ref }}
33+
preview=${{ github.event.inputs.preview }}
34+
echo "preview [$preview]"
2935
else
3036
echo "::error ::Unsupported EVENT_NAME [$EVENT_NAME]"
3137
exit 1
3238
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
3343
echo "slicer_repository=$slicer_repository" >> $GITHUB_OUTPUT
3444
echo "slicer_ref=$slicer_ref" >> $GITHUB_OUTPUT
45+
echo "preview=$preview" >> $GITHUB_OUTPUT
3546
env:
3647
EVENT_NAME: ${{ github.event_name }}
3748

@@ -172,6 +183,7 @@ jobs:
172183

173184
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174185
with:
186+
repository: Slicer/${{ toJSON(steps.collect_inputs.outputs.preview) && 'preview.apidocs.slicer.org' || 'apidocs.slicer.org' }}
175187
ref: gh-pages
176188
path: gh-pages
177189
token: ${{ steps.app-token.outputs.token }}
@@ -208,7 +220,6 @@ jobs:
208220
--publish-github-repo-branch gh-pages \
209221
--publish-github-skip-auth
210222
env:
211-
PUBLISH_GITHUB_PROJECT_NAME: apidocs.slicer.org
212223
PUBLISH_GITHUB_USERNAME: ${{ steps.committer.outputs.committer-name }}
213224
PUBLISH_GITHUB_USERMAIL: ${{ steps.committer.outputs.committer-email }}
214225
SLICER_REPO_NAME: ${{ steps.collect_inputs.outputs.slicer_repository }}

0 commit comments

Comments
 (0)