Skip to content

Commit 5b3d813

Browse files
committed
Build docs on PRs, only publish on push
1 parent 18cefe3 commit 5b3d813

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/build_workflow.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ jobs:
8686
run: |
8787
python -m unittest tests/test_*.py
8888
89-
# If the branch updates documentation, then the docs will need to be updated.
90-
publish-docs:
91-
if: github.event_name == 'push'
89+
# Build documentation on all PRs and pushes; only publish (commit to gh-pages) on pushes.
90+
build-docs:
9291
needs: [pre-commit-hooks, build]
9392
runs-on: ubuntu-latest
9493
defaults:
@@ -128,6 +127,7 @@ jobs:
128127
sphinx-multiversion source _build/html
129128
130129
- name: Copy Docs and Commit
130+
if: github.event_name == 'push'
131131
run: |
132132
# gh-pages branch must already exist
133133
git clone https://github.com/E3SM-Project/zstash.git --branch gh-pages --single-branch gh-pages
@@ -155,6 +155,7 @@ jobs:
155155
git commit -m "Update documentation" -a || true
156156
157157
- name: Push Changes
158+
if: github.event_name == 'push'
158159
uses: ad-m/github-push-action@master
159160
with:
160161
branch: gh-pages

0 commit comments

Comments
 (0)