-
Notifications
You must be signed in to change notification settings - Fork 85
54 lines (51 loc) · 1.86 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Nalu-Wind-Docs
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{github.ref}}-${{github.head_ref}}-docs
cancel-in-progress: true
jobs:
Docs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y --no-install-recommends doxygen graphviz
python3 -m pip install --upgrade pip
pip3 install sphinx sphinx_rtd_theme sphinxcontrib-bibtex
- name: Build
# execute from top-level nalu-wind directory
run: |
mkdir -p ./build_docs/doxygen
doxygen ./docs/doxygen/Doxyfile
echo "::add-matcher::.github/problem-matchers/sphinx.json"
sphinx-build -M html ./docs/sphinx ./build_docs/manual -W --keep-going -n 2>&1 | tee -a build-output.txt
mv ./build_docs/manual/html ./documentation
mv ./build_docs/doxygen/html ./documentation/api_docs
touch ./documentation/.nojekyll
- name: Report
run: |
echo "::add-matcher::.github/problem-matchers/sphinx.json"
egrep "WARNING:|Warning:|ERROR:|Error:" build-output.txt | sort | uniq | \
awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > build-output-warnings.txt
cat build-output-warnings.txt
exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}')
- name: Deploy
if: github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BRANCH: gh-pages
FOLDER: documentation
SINGLE_COMMIT: true