-
Notifications
You must be signed in to change notification settings - Fork 19
79 lines (63 loc) · 2.38 KB
/
documentation.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: documentation
on: [push, pull_request, workflow_dispatch]
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
python -m pip install sphinx-toolbox
pip install sphinx sphinx_rtd_theme myst_parser
sudo apt-get install doxygen graphviz -y
- name: Sphinx build
run: |
sphinx-build doc/sphinx _build
- name: Doxygen build
run: |
pushd doc/doxygen
doxygen Doxyfile
popd
git config --global user.email "[email protected]"
git config --global user.name "CSE-CI"
MASTER_COMMIT=$(git rev-parse --short HEAD)
REPO_SLUG="${REPO_SLUG:-analogdevicesinc/precision-converters-firmware}"
git fetch --depth 1 origin +refs/heads/gh-pages:gh-pages
git checkout gh-pages
# Create doxygen folder holding new build content
mkdir -p doxygen
cp -R doc/doxygen/html/* doxygen/
rm -rf doc
# Create .nojekyll file
touch nojekyll
CURRENT_COMMIT=$(git log -1 --pretty=%B)
if [[ ${CURRENT_COMMIT:(-7)} != ${MASTER_COMMIT:0:7} ]]
then
git add --all .
git commit --allow-empty --amend -m "Update documentation to ${MASTER_COMMIT:0:7}"
if [ -n "$GITHUB_DOC_TOKEN" ] ; then
git push https://${GITHUB_DOC_TOKEN}@github.com/${REPO_SLUG} gh-pages -f
else
git push origin gh-pages -f
fi
# echo_green "Documetation updated!"
else
# echo_green "Documentation already up to date!"
fi
# - name: Deploy doxygen to GitHub Pages
# uses: DenverCoder1/[email protected]
# with:
# branch: gh-pages
# github_token: ${{ secrets.GITHUB_TOKEN }}
# folder: doxygen
# config_file: doc/doxygen/Doxyfile
- name: Deploy sphinx to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true