Skip to content

Commit ae8762e

Browse files
committed
chore(.github): added workflow for building mdbook
1 parent e3386df commit ae8762e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/mdbook-build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
3+
name: MdBook Build and Deploy
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build-and-deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Install Nix package manager
23+
uses: DeterminateSystems/nix-installer-action@main
24+
25+
- name: Build the book using Nix
26+
run: |
27+
nix build .#mdbookBuild
28+
ls -la result
29+
30+
- name: Copy build result
31+
run: |
32+
mkdir -p build_output
33+
cp -r result/* build_output
34+
35+
- name: Deploy build to gh-pages branch
36+
uses: crazy-max/ghaction-github-pages@v4
37+
with:
38+
target_branch: gh-pages
39+
build_dir: build_output
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)