File tree Expand file tree Collapse file tree 2 files changed +48
-9
lines changed
Expand file tree Collapse file tree 2 files changed +48
-9
lines changed Original file line number Diff line number Diff line change 1+
2+ name : Build docs
3+
4+ on :
5+ pull_request :
6+ branches : [ master, 'maint/*' ]
7+
8+ jobs :
9+ build :
10+ if : " !contains(github.event.head_commit.message, '[skip ci]')"
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v2
15+
16+ - name : Determine current branch/tag name
17+ run : |
18+ if [[ "$GITHUB_REF" == refs/pull/* ]]; then
19+ CURBRANCH=${GITHUB_REF%/*}
20+ CURBRANCH=${CURBRANCH##*/}
21+ elif [[ "$GITHUB_REF" == refs/heads/* ]]; then
22+ CURBRANCH=${GITHUB_REF##*/}
23+ elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
24+ echo "This build should not be picking up a tag, cancelling."
25+ exit 1
26+ fi
27+
28+ # Remove forward slashes
29+ CURBRANCH=$( echo $CURBRANCH | sed 's+/+_+g' )
30+ echo "Building branch/tag ${CURBRANCH:-<unkwown>}, from git ref <$GITHUB_REF>"
31+ echo "CURBRANCH=${CURBRANCH}" >> ${GITHUB_ENV}
32+
33+ - name : Install GraphViz
34+ run : |
35+ sudo apt-get update -y
36+ sudo apt-get install -y graphviz
37+
38+ - name : Install dependencies
39+ run : |
40+ pip install -r docs/requirements.txt
41+
42+ - name : Build docs
43+ run : |
44+ make -C docs/ SPHINXOPTS="-W" BUILDDIR="$HOME/docs" CURBRANCH="${CURBRANCH:-html}" html
Original file line number Diff line number Diff line change 11
2- name : Build docs
2+ name : Build & update docs
33
44on :
55 push :
6- branches : [ 'doc/*', 'docs/*' ]
7- tags : [ '*' ]
8- pull_request :
9- branches : [ master, 'maint/*' ]
10-
11- create :
6+ branches : [ 'doc/*', 'docs/*', master, "maint/*" ]
127 tags : [ '*' ]
138
149jobs :
4944 make -C docs/ SPHINXOPTS="-W" BUILDDIR="$HOME/docs" CURBRANCH="${CURBRANCH:-html}" html
5045
5146 - name : Push created tag to gh-pages
52- if : github.event_name == 'create'
47+ if : startsWith( github.ref, 'refs/tags/')
5348 run : |
5449 MAJOR_MINOR=${CURBRANCH%.*}
5550 if [[ "${MAJOR_MINOR" == "" ]]; then
6560 git commit -am "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
6661 git push
6762
68- - name : Push merge commit into master to gh-pages
63+ - name : Push " master" docs to gh-pages after a PR is merged
6964 if : github.event.pull_request.merged == true
7065 run : |
7166 if [[ "${CURBRANCH" != "master" ]]; then
You can’t perform that action at this time.
0 commit comments