-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.83 KB
/
deploy_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
name: Deploy Documentation to GitHub Pages
on:
push:
branches:
- gh-pages
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: gh-pages
fetch-depth: 0 # Full history needed for branch checkout
- name: Install Doxygen and Dependencies
run: sudo apt-get install -y doxygen graphviz texlive
- name: Checkout doxygen-awesome
run: git clone https://github.com/jothepro/doxygen-awesome-css.git doxygen-awesome-css
- name: Generate and Deploy Doxygen Documentation
run: |
branches=("master:core" "duo" "handle" "orbit" "gloves" "desktop" "spark" "chromadeck")
for item in "${branches[@]}"; do
IFS=':' read -r branch dest <<< "$item"
# Default destination is the branch name unless specified
dest="${dest:-$branch}"
# Checkout each branch, generate documentation, and move it to the correct directory
git checkout $branch
doxygen Doxyfile
# Move generated files to a temporary directory
temp_dir="/tmp/docs_$dest"
mkdir -p $temp_dir
mv docs/* $temp_dir/
# Ensure the final destination directory is prepared in the gh-pages branch
mkdir -p docs/$dest
mv $temp_dir/* docs/$dest/
# Clean up the temporary directory
rm -rf $temp_dir
echo "Generated docs for $branch, deployed to docs/$dest"
done
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./docs
pre_clean: true