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 14
14
push :
15
15
branches :
16
16
- master
17
+ # release branches have names like 0.8.x, 0.9.x, ...
18
+ - ' [0-9]+.[0-9]+.x'
17
19
# At this day, GitHub doesn't support YAML anchors, d'oh!
18
20
paths :
19
21
- ' docs/**'
24
26
jobs :
25
27
build :
26
28
runs-on : ubuntu-latest
29
+ env :
30
+ REMOTE : https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git
27
31
28
32
steps :
29
33
- name : Checkout
@@ -69,12 +73,17 @@ jobs:
69
73
python3 -m pip install -r ./requirements_docs.txt
70
74
71
75
- name : Build docs website
76
+ # this runs on every PR to ensure the docs build is sane
77
+ if : github.event_name == 'pull_request'
72
78
run : task docs:build
73
79
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