Skip to content

Commit 965f51f

Browse files
committed
Make both _docs.yml and _push_docs.yml build docs
1 parent ad03418 commit 965f51f

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/_push_docs.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,40 @@ on:
22
workflow_call:
33

44
jobs:
5-
publish:
5+
build:
66
runs-on: ubuntu-latest
77

88
steps:
9+
- name: Avoid git conflicts when tag and branch pushed at same time
10+
if: github.ref_type == 'tag'
11+
run: sleep 60
12+
913
- name: Checkout
1014
uses: actions/checkout@v4
1115
with:
1216
# Need this to get version number from last tag
1317
fetch-depth: 0
1418

15-
- name: Download built docs artifact
16-
uses: actions/download-artifact@v4
19+
- name: Install system packages
20+
run: sudo apt-get install graphviz
21+
22+
- name: Install python packages
23+
uses: ./.github/actions/install_requirements
24+
25+
- name: Build docs
26+
run: tox -e docs
27+
28+
- name: Remove environment.pickle
29+
run: rm build/html/.doctrees/environment.pickle
30+
31+
- name: Upload built docs artifact
32+
uses: actions/upload-artifact@v4
1733
with:
1834
name: docs
1935
path: build
2036

2137
- name: Sanitize ref name for docs version
22-
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z-1-9._-]/_}" >> $GITHUB_ENV
38+
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV
2339

2440
- name: Move to versioned directory
2541
run: mv build/html .github/pages/$DOCS_VERSION
@@ -28,6 +44,7 @@ jobs:
2844
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
2945

3046
- name: Publish Docs to gh-pages
47+
if: github.ref_type == 'tag' || github.ref_name == 'main'
3148
# We pin to the SHA, not the tag, for security reasons.
3249
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
3350
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0

0 commit comments

Comments
 (0)