-
Notifications
You must be signed in to change notification settings - Fork 58
49 lines (46 loc) · 1.45 KB
/
mdbook.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
name: mdBook
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *" # Once a day
jobs:
mdbook:
runs-on: ubuntu-latest
permissions:
# For writing to gh-pages branch.
contents: write
steps:
- name: Checkout this repo
uses: actions/checkout@v3
# Gather mdbook source files - approved (merged) files, and open PRs.
- name: Gather mdbook sources
uses: actions/github-script@v7
with:
script: |
const script = require('.github/scripts/gather-mdbook-sources.js')
await script({github, context})
- name: Build the mdbook SUMMARY.md
uses: actions/github-script@v7
with:
script: |
const script = require('.github/scripts/build-mdbook-summary.js')
await script({github, context})
- name: Setup mdBook binary
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
with:
mdbook-version: '0.4.36'
- name: Install dependencies
run: |
cargo install [email protected]
- name: Generate the mdbook
run: |
cd mdbook
rm -rf ./book/
mdbook build --dest-dir ./book/
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
with:
publish_dir: ./mdbook/book
github_token: ${{ secrets.GITHUB_TOKEN }}