File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 1414 push :
1515 branches :
1616 - master
17+ # release branches have names like 0.8.x, 0.9.x, ...
18+ - ' [0-9]+.[0-9]+.x'
1719 # At this day, GitHub doesn't support YAML anchors, d'oh!
1820 paths :
1921 - ' docs/**'
2426jobs :
2527 build :
2628 runs-on : ubuntu-latest
29+ env :
30+ REMOTE : https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git
2731
2832 steps :
2933 - name : Checkout
@@ -69,12 +73,17 @@ jobs:
6973 python3 -m pip install -r ./requirements_docs.txt
7074
7175 - name : Build docs website
76+ # this runs on every PR to ensure the docs build is sane
77+ if : github.event_name == 'pull_request'
7278 run : task docs:build
7379
74- - name : Deploy
75- # publish docs only when PR is merged on master
76- if : github.event_name == 'push'
77- uses : peaceiris/actions-gh-pages@v3
78- with :
79- github_token : ${{ secrets.GITHUB_TOKEN }}
80- publish_dir : ./public
80+ - name : Publish dev docs
81+ # dev docs are published every time a commit is pushed to master
82+ if : github.event_name == 'push' && github.ref == 'master'
83+ run : task docs:publish DOCS_REMOTE=$REMOTE DOCS_VERSION=dev
84+
85+ - name : Publish versioned docs
86+ # versioned docs are published every time a commit is pushed to
87+ # a release branch
88+ if : github.event_name == 'push' && github.ref != 'master'
89+ run : task docs:publish DOCS_REMOTE=$REMOTE DOCS_VERSION=${{github.ref}}
You can’t perform that action at this time.
0 commit comments