From 9bc40179e4f6f799d5b2a9d04fdbe1a518fef60d Mon Sep 17 00:00:00 2001 From: refcell Date: Tue, 1 Oct 2024 17:33:57 -0400 Subject: [PATCH] feat: gh-pages --- .github/workflows/book.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/book.yaml diff --git a/.github/workflows/book.yaml b/.github/workflows/book.yaml new file mode 100644 index 0000000..a8091da --- /dev/null +++ b/.github/workflows/book.yaml @@ -0,0 +1,34 @@ +name: Book Deployment + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: write + deployments: write + name: Publish to GitHub Pages + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Install Rust stable toolchain + uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Setup mdbook + run: | + cargo install mdbook mdbook-mermaid mdbook-template + - name: Build book + working-directory: . + run: mdbook build + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book