From 400b295c51deb7e67bd5fd297de9142e396727d3 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:15:17 +0200 Subject: [PATCH 1/8] chore: upgrade github pages action to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 363e8b7d..f7901101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,7 +153,7 @@ jobs: mdbook build - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} From 559de5aaf3309458cc79c1795923a03259050660 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:35:59 +0200 Subject: [PATCH 2/8] fix: mdbook worflow --- .github/workflows/ci.yml | 34 +---------------------- .github/workflows/pages.yml | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7901101..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@v4 - 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..aeaa38e4 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,55 @@ +name: Deploy docs to Github Pages + +on: + push: + branches: + - main + - ielashi/mdbook_worflow +# 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 job + build: + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.48 + MDBOOK_ADMONISH_VERSION: 0.4.48 + 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 ${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 From f2057da05c64bb45c694525167ec281a86664385 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:42:00 +0200 Subject: [PATCH 3/8] . --- .github/workflows/pages.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index aeaa38e4..0359f95f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,10 +1,11 @@ name: Deploy docs to Github Pages on: - push: - branches: - - main - - ielashi/mdbook_worflow + pull_request: +# push: + # branches: + # - main + # - ielashi/mdbook_worflow # paths: # - 'docs/**' @@ -22,13 +23,14 @@ jobs: env: MDBOOK_VERSION: 0.4.48 MDBOOK_ADMONISH_VERSION: 0.4.48 + RUST_VERSION: 1.84.0 steps: - uses: actions/checkout@v4 - name: Install Rust run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} + rustup update ${RUST_VERSION} --no-self-update + rustup default ${RUST_VERSION} rustup target add wasm32-unknown-unknown - name: Install mdbook From 6072e1020a7b691703197a6acaf28e571baba2e6 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:43:24 +0200 Subject: [PATCH 4/8] . --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0359f95f..4e93500d 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v4 - if: ${{ github.ref == 'refs/heads/main' }} + # if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/book From 3e717f1218887d34c034f332084b2b10a511b9ea Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:47:55 +0200 Subject: [PATCH 5/8] . --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 4e93500d..d31d0acb 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest env: MDBOOK_VERSION: 0.4.48 - MDBOOK_ADMONISH_VERSION: 0.4.48 + MDBOOK_ADMONISH_VERSION: 1.19.0 RUST_VERSION: 1.84.0 steps: - uses: actions/checkout@v4 From ee57963299f848763a19d56c8f4ccc02abb54688 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 13:53:09 +0200 Subject: [PATCH 6/8] . --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afd4f2c6..e1626ea0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ name: CI -on: [pull_request] +on: #pull_request] + workflow_dispatch: jobs: build: From 2b557ad0bb35718d98fc9c0126fefa7805cb0250 Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 14:06:11 +0200 Subject: [PATCH 7/8] . --- .github/workflows/ci.yml | 3 +-- .github/workflows/pages.yml | 14 +++++++------- README.md | 3 ++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1626ea0..afd4f2c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,5 @@ name: CI -on: #pull_request] - workflow_dispatch: +on: [pull_request] jobs: build: diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d31d0acb..402e5c0a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,13 +1,13 @@ name: Deploy docs to Github Pages on: + # Only run this workflow when there are changes to the docs directory pull_request: -# push: - # branches: - # - main - # - ielashi/mdbook_worflow -# paths: - # - 'docs/**' + paths: + - 'docs/**' + push: + paths: + - 'docs/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -51,7 +51,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v4 - # if: ${{ github.ref == 'refs/heads/main' }} + 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 From f62b92237f0226611e051318e8b3c4c5e223ef7c Mon Sep 17 00:00:00 2001 From: Islam El-Ashi Date: Tue, 6 May 2025 14:08:24 +0200 Subject: [PATCH 8/8] . --- .github/workflows/pages.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 402e5c0a..c0dd6fcf 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,4 +1,4 @@ -name: Deploy docs to Github Pages +name: Github Pages Book on: # Only run this workflow when there are changes to the docs directory @@ -17,8 +17,7 @@ permissions: contents: write jobs: - # Build job - build: + build-and-deploy: runs-on: ubuntu-latest env: MDBOOK_VERSION: 0.4.48