Skip to content

Commit 15e17a1

Browse files
committed
ci(publish-docs.yml): add manual trigger to workflow
1 parent 5d6a54d commit 15e17a1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/publish-docs.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ on:
2121
required: false
2222
default: false
2323
type: boolean
24+
workflow_dispatch:
25+
inputs:
26+
version:
27+
description: 'The "name" of the version to be published. IMPORTANT: This only _names_ the published docs, it does not affect what is actually published. This workflow always builds and publishes the docs for whatever is the latest in the branch on which it is run.'
28+
required: true
29+
type: string
30+
forcePush:
31+
description: 'Pass `true` if git push should use `--force`.'
32+
required: false
33+
default: false
34+
type: boolean
2435

2536
jobs:
2637

@@ -34,10 +45,10 @@ jobs:
3445
- run: git config --global user.email "[email protected]"
3546
- run: git config --global user.name "Lime Technologies OSS"
3647
- name: Publish docs
37-
if: inputs.buildOnly == false
48+
if: github.event_name == 'workflow_dispatch' || inputs.buildOnly == false
3849
env:
39-
DOCS_VERSION: ${{ inputs.version }}
40-
FORCE_PUSH: ${{ inputs.forcePush }}
50+
DOCS_VERSION: ${{ inputs.version || github.event.inputs.version }}
51+
FORCE_PUSH: ${{ inputs.forcePush || github.event.inputs.forcePush || 'false' }}
4152
GH_TOKEN: ${{ secrets.PUBLISH_DOCS }}
4253
run: |
4354
if [ "$FORCE_PUSH" = "true" ]; then
@@ -46,11 +57,11 @@ jobs:
4657
npm run docs:publish -- --v="$DOCS_VERSION"
4758
fi
4859
- name: Build docs, but do not publish
49-
if: inputs.buildOnly
60+
if: github.event_name == 'workflow_call' && inputs.buildOnly
5061
run: npm run docs:build
5162

5263
link-docs:
53-
if: inputs.buildOnly == false && inputs.linkToPR == true
64+
if: github.event_name == 'workflow_call' && inputs.buildOnly == false && inputs.linkToPR == true
5465
name: Post link to docs on PR
5566
needs: [publish-docs]
5667
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)