Skip to content

Commit f168f75

Browse files
committed
docs: add GitHub Pages deployment via mdBook
1 parent 80d4952 commit f168f75

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/**"
8+
- ".github/workflows/pages.yml"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install mdBook
27+
env:
28+
MDBOOK_VERSION: "0.4.40"
29+
run: |
30+
curl -sSL \
31+
"https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
32+
| tar -xz --directory /usr/local/bin
33+
mdbook --version
34+
35+
- name: Build docs
36+
run: mdbook build docs/
37+
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v5
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: docs/book
45+
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

docs/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ no-section-label = false
1010
fold.enable = true
1111
fold.level = 1
1212
additional-css = ["custom.css"]
13+
git-repository-url = "https://github.com/copyleftdev/parallax"
14+
git-repository-icon = "fa-github"
15+
site-url = "/parallax/"
1316

1417
[output.html.playground]
1518
editable = true

0 commit comments

Comments
 (0)