@@ -11,56 +11,29 @@ jobs:
1111 with :
1212 path : " tutorial"
1313
14- - name : Checkout generator
15- uses : actions/checkout@v2
16- with :
17- repository : " viperproject/viperonline-tutorial-generator"
18- token : ${{ secrets.GH_PAT }}
19- path : " generator"
20-
2114 - name : Checkout build branch
2215 uses : actions/checkout@v2
2316 with :
2417 ref : " build"
25- path : " generator/build"
26-
27- - name : Create directory structure
28- run : |
29- cd generator
30- rm -rf build/css build/images build/js
31- cp -r assets/css build/css
32- cp -r assets/images build/images
33- cp -r assets/js build/js
18+ path : " tutorial/book"
3419
35- - name : Install node packages
36- run : |
37- cd generator
38- npm install
20+ - name : Setup mdBook
21+ uses : peaceiris/actions-mdbook@v1
22+ with :
23+ mdbook-version : " latest "
3924
4025 - name : Generate tutorial
4126 run : |
42- cd generator
43- node index.js \
44- ../tutorial/tutorial/introduction.md \
45- ../tutorial/tutorial/structure.md \
46- ../tutorial/tutorial/permissions.md \
47- ../tutorial/tutorial/predicates.md \
48- ../tutorial/tutorial/functions.md \
49- ../tutorial/tutorial/quantifiers.md \
50- ../tutorial/tutorial/quantified-permissions.md \
51- ../tutorial/tutorial/magic-wands.md \
52- ../tutorial/tutorial/statements.md \
53- ../tutorial/tutorial/expressions-and-assertions.md \
54- ../tutorial/tutorial/domains.md \
55- ../tutorial/tutorial/termination.md \
56- ../tutorial/tutorial/further-info.md
27+ cd tutorial
28+ mdbook build
5729
5830 - name : Create build commit
31+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
5932 run : |
60- cd generator/build
33+ cd tutorial/book
6134 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
6235 git config --local user.name "github-actions[bot]"
63- git add css images js index .html
36+ git add css FontAwesome fonts * .html *.js *.css
6437 git commit -m "Deploy $(date +'%Y-%m-%d %H:%M:%S')"
6538
6639 - name : Push tutorial to build branch
6942 with :
7043 branch : build
7144 force : true
72- directory : generator/build
45+ directory : tutorial/book
0 commit comments