-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.47 KB
/
documentation.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Documentation
on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
upa_deploy: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || '' }}
upa_docs_repository: upa-url/docs
# Used in Doxyfile: PROJECT_NUMBER = $(UPA_DOCS_VERSION)
UPA_DOCS_VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
# Check C++ examples in documentation
- name: Extract and try to build C++ examples from docs
run: |
tools/extract-cpp.py examples/extracted-cpp README.md
cmake -S . -B build -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=20 -DUPA_BUILD_TESTS=OFF -DUPA_BUILD_EXTRACTED=ON
cmake --build build
# Install and run doxygen
- name: Download theme
run: doc/download-theme.sh
- uses: ssciwr/doxygen-install@v1
with:
version: "1.12.0"
- name: Run doxygen
run: /usr/local/bin/doxygen
# Deploy docs
- name: Is there a gh-pages branch?
if: env.upa_deploy
run: echo "upa_checkout=$(git ls-remote --heads https://github.com/$upa_docs_repository.git refs/heads/gh-pages)" >> "$GITHUB_ENV"
- name: Checkout ${{ env.upa_docs_repository }}
uses: actions/checkout@v4
if: env.upa_deploy && env.upa_checkout
with:
repository: ${{ env.upa_docs_repository }}
ref: gh-pages
path: build-docs
- name: Update versions.txt
if: env.upa_deploy
run: |
mkdir -p build-docs
echo "upa_docs_dir=$(tools/update-docs-versions.py build-docs $GITHUB_REF)" >> "$GITHUB_ENV"
- name: Prepare directory for publication
if: env.upa_deploy && env.upa_docs_dir
run: |
sudo chown --recursive $USER doc/html
rm -rf build-docs/.git
rm -rf build-docs/common
rm -rf build-docs/${{ env.upa_docs_dir }}
cp -r doc/common build-docs/common
mv doc/html build-docs/${{ env.upa_docs_dir }}
cp doc/index.html build-docs
- name: Deploy to ${{ env.upa_docs_repository }}
uses: JamesIves/github-pages-deploy-action@v4
if: env.upa_deploy && env.upa_docs_dir
with:
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
repository-name: ${{ env.upa_docs_repository }}
folder: build-docs