diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 363e8b7d..afd4f2c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,39 +130,10 @@ 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, documentation-book] + needs: [build, examples, benchmark] runs-on: ubuntu-latest steps: - name: check build result @@ -174,6 +145,3 @@ 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/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..c0dd6fcf --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,56 @@ +name: Github Pages Book + +on: + # Only run this workflow when there are changes to the docs directory + pull_request: + paths: + - 'docs/**' + push: + paths: + - 'docs/**' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.48 + MDBOOK_ADMONISH_VERSION: 1.19.0 + RUST_VERSION: 1.84.0 + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + rustup update ${RUST_VERSION} --no-self-update + rustup default ${RUST_VERSION} + rustup target add wasm32-unknown-unknown + + - name: Install mdbook + run: | + cargo install mdbook --version ${MDBOOK_VERSION} + cargo install mdbook-admonish --version ${MDBOOK_ADMONISH_VERSION} + + - name: Build book + run: | + cd docs + mdbook-admonish install + mdbook build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs/book + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book diff --git a/README.md b/README.md index 1c93fcb0..06c54d95 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ A collection of scalable data structures for the [Internet Computer](https://int Stable structures are designed to use stable memory as the backing store, allowing them to grow to gigabytes in size without the need for `pre_upgrade`/`post_upgrade` hooks. +You can read more about the library in the [Stable Structures Book](https://dfinity.github.io/stable-structures/) + ## Background The conventional approach to canister state persistence is to serialize the entire state to stable memory in the `pre_upgrade` hook and decode it back in the `post_upgrade` hook. @@ -18,7 +20,6 @@ This approach is easy to implement and works well for relatively small datasets. Unfortunately, it does not scale well and can render a canister non-upgradable. This library aims to simplify managing data structures directly in stable memory. -For more information about the philosophy behind the library, see [Roman's tutorial on stable structures](https://mmapped.blog/posts/14-stable-structures.html). ## Available Data Structures