Skip to content

Commit 1c3afa0

Browse files
committed
Add GH Pages workflow
1 parent 62f69de commit 1c3afa0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/deploy.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on: [push]
4+
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write # To push a branch
10+
pages: write # To push to a GitHub Pages site
11+
id-token: write # To update the deployment status
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Install mdbook
15+
run: |
16+
ver='v0.4.40'
17+
url="https://github.com/rust-lang/mdBook/releases/download/${ver}/mdbook-${ver}-x86_64-unknown-linux-gnu.tar.gz"
18+
mkdir mdbook
19+
echo "${PWD}/mdbook" >> "$GITHUB_PATH"
20+
curl -sSL "$url" | tar -xz --directory=mdbook
21+
- name: Install mdbook-katex
22+
run: |
23+
ver='0.9.0'
24+
url="https://github.com/lzanini/mdbook-katex/releases/download/${ver}-binaries/mdbook-katex-v${ver}-x86_64-unknown-linux-gnu.tar.gz"
25+
mkdir mdbook-katex
26+
echo "${PWD}/mdbook-katex" >> "$GITHUB_PATH"
27+
curl -sSL "$url" | tar -xz --directory=mdbook-katex
28+
- name: Build the site
29+
run: mdbook build
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: 'book'
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4
39+

0 commit comments

Comments
 (0)