-
-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (64 loc) · 2.08 KB
/
deploy-doxygen.yml
File metadata and controls
75 lines (64 loc) · 2.08 KB
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
name: Deploy Doxygen (Latest)
on:
push:
branches: [master]
paths:
- 'include/**.hpp'
- 'README.md'
- 'doc/**.md'
- '.codedocs'
release:
types: [published]
jobs:
ci:
name: Deployment Agent
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y doxygen
doxygen --version
- name: Generate Documentation
run: |
mkdir -p "$(pwd)/build/doc"
doxygen "$(pwd)/.codedocs"
- name: Prepare Pages
run: |
if [ ${{ github.event_name }} == "release" ]; then
version="v$(conan inspect . --attribute version | sed 's@version: @@g')"
echo "API_DOC_PATH=$(pwd)/dist/api/${version}" >> $GITHUB_ENV
else
echo "API_DOC_PATH=$(pwd)/dist/api/latest" >> $GITHUB_ENV
fi
# Clone a git repo for doxygen
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git clone --single-branch -b gh-pages "https://github.com/${GITHUB_REPOSITORY}" "dist"
git config --global push.default simple
- name: Update Pages
run: |
# Add a .nojekyll file
touch "dist/.nojekyll"
rm -rf "${API_DOC_PATH}"
mkdir -p "${API_DOC_PATH}"
mv $(pwd)/build/doc/html/* "${API_DOC_PATH}"
cd "dist"
git add --all
if ! git diff-index --quiet HEAD --; then
git commit \
-m "📖 Deploy codedocs to Github Pages" \
-m "Documentation updated by build ${{ github.run_number }}." \
-m "Commit: '${{ github.sha }}'" \
--author "GitHub Action <action@github.com>" \
--no-gpg-sign
fi
cd ..
- name: Publish Pages
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: dist