bbtree 0.1.2

Blessed B-tree.
Documentation
# Publishes the visualizer (`vis/`), the explorer and the post, to GitHub
# Pages at https://bbtree.xiangpeng.systems on every push to main, which is
# every merged pull request, and on demand.
#
# One-time setup, outside this file:
# - Settings → Pages → Source: "GitHub Actions".
# - Settings → Pages → Custom domain: bbtree.xiangpeng.systems (an Actions
#   deploy ignores a CNAME file), then "Enforce HTTPS" once the certificate
#   is issued.
# - DNS: a CNAME record from bbtree.xiangpeng.systems to
#   xiangpenghao.github.io.
name: pages

on:
  push:
    branches: [main]
  workflow_dispatch:

# One deploy at a time, and none cancelled halfway: a later push waits.
concurrency:
  group: pages
  cancel-in-progress: false

permissions:
  contents: read

jobs:
  build:
    name: build the visualizer
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # The flake's dev shell has the toolchain the README builds with: the
      # pinned nightly with wasm32, and the nixpkgs `dx`, which wraps the
      # wasm-bindgen-cli that vis/Cargo.toml pins.
      - uses: cachix/install-nix-action@v31

      - name: Build
        run: nix develop --command bash -c 'cd vis && dx build --release --debug-symbols false'

      # The post is served at /post/ from its own copy of the page, and any
      # other path falls back to it, as the README's static hosting does.
      - name: Lay out the site
        run: |
          site=vis/target/dx/bbtree-vis/release/web/public
          mkdir -p "$site/post"
          cp "$site/index.html" "$site/post/index.html"
          cp "$site/index.html" "$site/404.html"

      - uses: actions/upload-pages-artifact@v3
        with:
          path: vis/target/dx/bbtree-vis/release/web/public

  deploy:
    name: deploy
    needs: build
    runs-on: ubuntu-latest
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - id: deployment
        uses: actions/deploy-pages@v4