Skip to content

chore: add SHA2 to the README and book intro (#1151) #61

chore: add SHA2 to the README and book intro (#1151)

chore: add SHA2 to the README and book intro (#1151) #61

name: Publish mdBook to Vercel
on:
push:
branches: ["main"]
paths:
- "book/**"
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Setup mdbook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- name: Install mdbook plugins
run: |
cargo install mdbook-katex mdbook-linkcheck mdbook-mermaid just
- name: Build the book
run: |
cd book
mdbook build
- name: Install Vercel CLI
run: npm install -g vercel
- name: Deploy to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Token stored in GitHub Secrets
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
run: |
cd book/book
mkdir .vercel
echo "{\"projectId\":\"$VERCEL_PROJECT_ID\",\"orgId\":\"$VERCEL_ORG_ID\"}" > .vercel/project.json
vercel --prod --token $VERCEL_TOKEN