77
88jobs :
99 build :
10+ name : " Docs CI"
1011 runs-on : ubuntu-latest
1112
1213 steps :
1314 - name : Checkout Source
1415 uses : actions/checkout@v2
1516 with :
16- # require all of history to see all tagged versions' docs
17+ # require history to get back to last tag for version number of brnaches
1718 fetch-depth : 0
1819 submodules : true
1920
@@ -22,49 +23,32 @@ jobs:
2223 with :
2324 python-version : " 3.7"
2425
25- - name : Install Packages
26- # Can delete this if you don't use graphviz in your docs
27- run : sudo apt-get install graphviz
28-
2926 - name : Install Python Dependencies
3027 run : |
3128 pip install pipenv
3229 pipenv install --dev --deploy --python $(which python) && pipenv graph
3330
34- - name : Deploy index
35- # We pin to the SHA, not the tag, for security reasons.
36- # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
37- uses : peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
38- with :
39- github_token : ${{ secrets.GITHUB_TOKEN }}
40- publish_dir : .github/pages
41- keep_files : true
31+ - name : Build Docs
32+ run : pipenv run docs
4233
43- - name : Checkout gh-pages
44- # As we already did a deploy of gh-pages above, it is guaranteed to be there
45- # so check it out so we can selectively build docs below
46- uses : actions/checkout@v2
34+ - uses : jungwinter/split@v1
35+ id : split
4736 with :
48- ref : gh-pages
49- path : build/html
50-
51- - name : Maybe use sphinx-multiversion
52- # If we are building master or a tag we will publish
53- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
54- # So use the args we normally pass to sphinx-build, but run sphinx-multiversion
55- run : mv $(pipenv --venv)/bin/sphinx-multiversion $(pipenv --venv)/bin/sphinx-build
37+ msg : ${{ github.ref }}
38+ seperator : /
39+ maxsplit : 2
5640
57- - name : Build Docs
58- run : pipenv run docs
41+ - name : Move to versioned directory
42+ # e.g. master or 0.1.2
43+ run : mv build/html ".github/pages/${{ steps.split.outputs._2 }}"
5944
6045 - name : Publish Docs to gh-pages
6146 # Only master and tags are published
62- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
47+ if : " ${{ github.repository_owner == 'dls-controls' }} "
6348 # We pin to the SHA, not the tag, for security reasons.
6449 # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
6550 uses : peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
6651 with :
6752 github_token : ${{ secrets.GITHUB_TOKEN }}
68- publish_dir : build/html
53+ publish_dir : .github/pages
6954 keep_files : true
70-
0 commit comments