-
Notifications
You must be signed in to change notification settings - Fork 17
42 lines (40 loc) · 1.55 KB
/
deploy.yaml
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
name: Deploy to GitHub Pages
on:
# Triggers the workflow on push or pull request events but
# only for the default branch.
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
fetch:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: v0.4.36
MDBOOKTOC_VERSION: 0.14.2
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install mdbook and mdbook-toc
run: |
mkdir installed-bins
curl -Lf "https://github.com/rust-lang/mdBook/releases/download/$MDBOOK_VERSION/mdbook-$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=./installed-bins
curl -Lf "https://github.com/badboy/mdbook-toc/releases/download/$MDBOOKTOC_VERSION/mdbook-toc-$MDBOOKTOC_VERSION-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=./installed-bins
echo `pwd`/installed-bins >> $GITHUB_PATH
- name: Install gh-pages
run: |
npm install gh-pages@"~6.1.1"
- name: Build book
run: |
mdbook --version
mdbook-toc --version
mdbook build
- name: Set Git config
run: |
git config --global user.email "[email protected]"
git config --global user.name 'Automation'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: Deploy to GitHub pages
run: |
npx gh-pages --message "Deploy docs" --no-history --dist book