File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
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 }}
You can’t perform that action at this time.
0 commit comments