Skip to content

Commit 345d827

Browse files
committed
ci: use mdbook to create documentation
1 parent a2bb94c commit 345d827

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Documentation
2+
3+
on: push
4+
5+
jobs:
6+
doc:
7+
runs-on: ubuntu-latest
8+
steps:
9+
# Checks-out the repository under $GITHUB_WORKSPACE.
10+
- name: Git checkout
11+
uses: actions/checkout@v5
12+
with:
13+
submodules: 'recursive'
14+
persist-credentials: false
15+
- name: Install Debian packages
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y wget
19+
- name: Download mdbook
20+
run: |
21+
wget https://github.com/rust-lang/mdBook/releases/download/v0.4.52/mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz
22+
CHECKSUM=$(sha256sum mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz)
23+
CHECKSUM_BITS=$(echo $CHECKSUM | cut -f 1 -d' ')
24+
echo Checksum calculation: $CHECKSUM
25+
CHECKSUM_BITS=$(echo $CHECKSUM | cut -f 1 -d' ')
26+
if [[ "$CHECKSUM_BITS" != "c0b903f01dd8f4edc644372ad2b80b1fdddd12552d37b6a098657cbd8eddd768" ]]
27+
then
28+
echo "Checksum of downloaded mdbook is wrong."
29+
exit 1
30+
fi
31+
tar xf mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz
32+
mv ./mdbook /usr/local/bin/
33+
unlink mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz
34+
- name: Generate documentation
35+
run: |
36+
cd "$GITHUB_WORKSPACE"/documentation
37+
mdbook build
38+
- name: Collect documentation artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: pmdb-documentation
42+
if-no-files-found: error
43+
path: |
44+
"$GITHUB_WORKSPACE/documentation/book/"

documentation/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book

documentation/SUMMARY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# pmdb
2+
3+
[Location of pmdb's files](directories.md)
4+
5+
[Templates](templates.md)
6+
7+
[Configuration file](configuration.md)
8+
9+
[Frequently asked questions](faq.md)

documentation/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[book]
2+
language = "en"
3+
src = "."

0 commit comments

Comments
 (0)