Skip to content
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
34 changes: 1 addition & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
56 changes: 56 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ 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.
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

Expand Down