File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and/or deploy documentation
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - " *"
10+
11+ jobs :
12+ build_docs :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+ - name : Generate HTML docs
17+ uses : ammaraskar/sphinx-action@master
18+ with :
19+ docs-folder : " doc/"
20+ pre-build-command : |
21+ apt-get update
22+ pip install -U pip
23+ pip install -e ".[doc]"
24+ - name : Upload generated HTML as artifact
25+ uses : actions/upload-artifact@v2
26+ with :
27+ name : DocHTML
28+ path : doc/_build/html/
29+
30+ deploy_docs :
31+ if : github.ref == 'refs/heads/main'
32+ needs : build_docs
33+ runs-on : ubuntu-latest
34+ steps :
35+ - uses : actions/checkout@v2
36+ - name : Download artifacts
37+ uses : actions/download-artifact@v2
38+ with :
39+ name : DocHTML
40+ path : doc/_build/html/
41+ - name : Commit to documentation branch
42+ run : |
43+ git clone --no-checkout --depth 1 https://github.com/alexisthual/brain-cockpit.git --branch gh-pages --single-branch gh-pages
44+ cp -r doc/_build/html/* gh-pages/
45+ cd gh-pages
46+ touch .nojekyll
47+ git config --local user.email "[email protected] " 48+ git config --local user.name "brain-cockpit GitHub Action"
49+ git add .
50+ git commit -m "Update documentation" -a || true
51+ - name : Push changes
52+ 53+ with :
54+ branch : gh-pages
55+ directory : gh-pages
56+ github_token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments