Skip to content

Commit 78fa020

Browse files
committed
Add publish input to _docs.yml
1 parent ad37180 commit 78fa020

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/_docs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
on:
22
workflow_call:
3+
inputs:
4+
publish:
5+
type: boolean
6+
description: If true, publishes docs to gh-pages
7+
38

49
jobs:
510
build:
@@ -44,7 +49,7 @@ jobs:
4449
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
4550

4651
- name: Publish Docs to gh-pages
47-
if: needs.test.result && (github.ref_type == 'tag' || github.ref_name == 'main')
52+
if: inputs.publish && (github.ref_type == 'tag' || github.ref_name == 'main')
4853
# We pin to the SHA, not the tag, for security reasons.
4954
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
5055
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
needs: [check, test]
3030
if: needs.check.outputs.branch-pr == ''
3131
uses: ./.github/workflows/_docs.yml
32+
with:
33+
publish: ${{needs.test.result == 'success'}}
3234
permissions:
3335
contents: write
3436

template/{% if git_platform=="github.com" %}.github{% endif %}/workflows/ci.yml.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
needs: [check, test]
4747
if: needs.check.outputs.branch-pr == ''
4848
uses: ./.github/workflows/_docs.yml
49+
with:
50+
publish: ${{needs.test.result == 'success'}}
51+
4952
{% endif %}
5053
dist:
5154
needs: check

0 commit comments

Comments
 (0)