-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (47 loc) · 1.63 KB
/
deploy-book.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions
name: book
# https://github.com/orgs/vercel/discussions/3307
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on: workflow_dispatch
jobs:
deploy-book:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install mdbook
uses: extractions/setup-crate@v1
with:
owner: rust-lang
name: mdBook
- name: Install KaTeX preprocessor
uses: extractions/setup-crate@v1
with:
owner: lzanini
name: mdbook-katex
- name: Install Mermaid preprocessor
uses: extractions/setup-crate@v1
with:
owner: badboy
name: mdbook-mermaid
# not using this one; but, might at some point
- name: Install ToC preprocessor
uses: extractions/setup-crate@v1
with:
owner: badboy
name: mdbook-toc
- name: Setup Node.js (required to install Vercel CLI)
uses: actions/setup-node@v3
- name: Generate static content for the book
run: npm run book:build
- name: Install Vercel CLI
run: npm install --global vercel
- name: Pull Vercel environment information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
run: vercel ./book/book --prod --token=${{ secrets.VERCEL_TOKEN }}