diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 985eec1..1697d69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci-push +name: ci on: push: branches-ignore: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 52f50ff..f395558 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/guide.yml b/.github/workflows/guide.yml new file mode 100644 index 0000000..b2a3280 --- /dev/null +++ b/.github/workflows/guide.yml @@ -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 diff --git a/guide/build.cmake b/guide/build.cmake index acf4de4..8589bc4 100644 --- a/guide/build.cmake +++ b/guide/build.cmake @@ -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() @@ -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")