forked from epfl-lasa/control-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.89 KB
/
generate-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
55
56
57
58
59
60
name: Generate and Deploy Documentation
on:
push:
branches:
- main
jobs:
check-version:
name: Check if the version has been updated
outputs:
has_changed: ${{ steps.check.outputs.has_changed }}
version: ${{ steps.versions.outputs.new_version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- id: versions
run: |
PREV_VERSION=$(git show HEAD^:VERSION)
NEW_VERSION=$(git show HEAD:VERSION)
echo "prev_version=${PREV_VERSION}" >> $GITHUB_OUTPUT
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
shell: bash
- uses: aica-technology/.github/.github/actions/compare-versions@v0.11.0
id: check
with:
previous_version: ${{ steps.versions.outputs.prev_version }}
new_version: ${{ steps.versions.outputs.new_version }}
deploy:
needs: check-version
name: Generate and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate docs
uses: mattnotmitt/doxygen-action@v1.9
with:
working-directory: 'doxygen'
doxyfile-path: 'doxygen.conf'
- name: Tag version
shell: bash
run: |
mkdir -p doxygen/docs/versions
sudo mv doxygen/docs/html doxygen/docs/versions/rolling
if [ ${{ needs.check-version.outputs.has_changed }} = 'true' ]; then
sudo cp -r doxygen/docs/versions/rolling doxygen/docs/versions/latest
sudo cp -r doxygen/docs/versions/rolling doxygen/docs/versions/${{ needs.check-version.outputs.version }}
fi
- name: Deploy to documentation branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./doxygen/docs
keep_files: true