Skip to content

Add CI workflow to build guide books #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci-push
name: ci
on:
push:
branches-ignore:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: build book
run: |
cd guide
cmake -P build.cmake
cmake -P build.cmake || exit 1
ls book
- name: setup pages
uses: actions/configure-pages@v4
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/guide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci-guide
on:
push:
branches-ignore:
- staging
jobs:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: init
run: |
url="https://github.com/rust-lang/mdBook/releases/download/v0.4.47/mdbook-v0.4.47-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: build
run: |
cd guide
cmake -P build.cmake || exit 1
ls book
5 changes: 3 additions & 2 deletions guide/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function(BuildBook LANGUAGE SOURCE_DIR TARGET_DIR)
message(WARNING "Skipping '${LANGUAGE}' – SUMMARY.md not found at ${SOURCE_DIR}")
return()
endif()

if(NOT EXISTS "${SOURCE_DIR}/book.toml")
message(WARNING "Skipping '${LANGUAGE}' – book.toml not found at ${SOURCE_DIR}")
return()
Expand All @@ -16,10 +16,11 @@ function(BuildBook LANGUAGE SOURCE_DIR TARGET_DIR)
execute_process(
COMMAND mdbook build -d ${TARGET_DIR}
WORKING_DIRECTORY ${SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
endfunction()

# Copy the theme folder
# Copy the theme folder
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/theme" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")

BuildBook("en" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/book")
Expand Down