diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afd4f2c6..363e8b7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,10 +130,39 @@ jobs: run: | bash ./scripts/ci_post_run_benchmark.sh + documentation-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + rustup update ${{ matrix.rust }} --no-self-update + rustup default ${{ matrix.rust }} + rustup target add wasm32-unknown-unknown + + - name: Install mdbook + run: | + cargo install mdbook --version 0.4.48 + cargo install mdbook-admonish --version 1.19.0 + + - name: Build book + run: | + cd docs + mdbook-admonish install + mdbook build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book + checks-pass: # Always run this job! if: always() - needs: [build, examples, benchmark] + needs: [build, examples, benchmark, documentation-book] runs-on: ubuntu-latest steps: - name: check build result @@ -145,3 +174,6 @@ jobs: - name: check benchmark result if: ${{ needs.benchmark.result != 'success' }} run: exit 1 + - name: check documentation-book result + if: ${{ needs.documentation-book.result != 'success' }} + run: exit 1 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..57030c42 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +*.css +book diff --git a/docs/book.toml b/docs/book.toml index 6d59056e..a4801568 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -18,3 +18,4 @@ additional-css = ["./mdbook-admonish.css"] [preprocessor.admonish] command = "mdbook-admonish" assets_version = "3.0.3" # do not edit: managed by `mdbook-admonish install` +