Skip to content

Commit 0f8792e

Browse files
committed
Add creation of gh-pages worktree to docs build (see https://olgarithms.github.io/sphinx-tutorial/docs/7-hosting-on-github-pages.html)
Added section to readme on manually updating the docs Remove *.zh-cn.* as they have not been updated to be specific to YggdrasilRapidJSON Added workflow to build/deploy docs
1 parent 5217ea0 commit 0f8792e

16 files changed

+51
-5665
lines changed

.github/workflows/docs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build the docs & publish to GitHub Pages
2+
'on':
3+
push:
4+
branches:
5+
- docs
6+
tags:
7+
- 'v*'
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
contents: write
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v5
15+
with:
16+
submodules: true
17+
- name: Configure git
18+
run: |
19+
git config --global user.name 'Meagan Lang'
20+
git config --global user.email 'langmm.astro@gmail.com'
21+
- name: Build
22+
run: |
23+
mkdir build
24+
cd build
25+
cmake .. -DRAPIDJSON_BUILD_DOC=ON -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
26+
cmake --build .
27+
- name: Add changes & push to deploy
28+
run: |
29+
cd build/doc/html
30+
git add -A
31+
git commit --allow-empty -m "Updated docs [via GitHub Action]"
32+
git push origin gh-pages

doc/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ ELSE()
88
list(APPEND MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../readme.md)
99

1010
CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
11-
CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY)
1211

1312
file(GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*)
14-
13+
1514
add_custom_command(OUTPUT html
15+
COMMAND git worktree add -f ${CMAKE_CURRENT_BINARY_DIR}/html gh-pages
1616
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
17-
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn
1817
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html
1918
DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES}
2019
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../

0 commit comments

Comments
 (0)