1- name : Build docs
1+ name : build and deploy docs
22
33on :
44 push :
55 branches :
6- - " master"
6+ - master
77 pull_request :
88
99permissions :
@@ -13,29 +13,69 @@ permissions:
1313
1414jobs :
1515 build :
16+ name : build and deploy docs
1617 runs-on : ubuntu-latest
1718 steps :
18- - name : Checkout Project
19+ - name : clean up
20+ run : |
21+ rm -rf Algorithm
22+ rm -rf $HOME/.elan
23+ rm -rf $HOME/.cache/mathlib
24+
25+ - name : Checkout repo
1926 uses : actions/checkout@v4
2027 with :
2128 fetch-depth : 2
2229 lfs : true
23- - name : Install Lean
30+
31+ - name : install elan
2432 run : |
25- curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s - -y --default-toolchain `cat ./lean-toolchain`
33+ set -o pipefail
34+ curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y
2635 echo "$HOME/.elan/bin" >> $GITHUB_PATH
27- - run : |
28- lake -Kenv=CI_BUILD exe cache get && lake -Kenv=CI_BUILD build && lake -Kenv=CI_BUILD build Algorithm:docs
29- - name : Fix permissions
36+
37+ - name : set default toolchain
38+ working-directory : Algorithm
39+ run : |
40+ elan default $(cat lean-toolchain)
41+
42+ - name : get cache
43+ working-directory : Algorithm
44+ run : lake exe cache get
45+
46+ - name : build algorithm
47+ working-directory : Algorithm
48+ run : env LEAN_ABORT_ON_PANIC=1 lake build
49+
50+ - name : build doc-gen4
51+ working-directory : Algorithm
3052 run : |
31- chmod -c -R +rX "./.lake/build/doc/" | while read line; do
32- echo "::warning title=Invalid file permissions automatically fixed::$line"
33- done
53+ lake build doc-gen4
54+
55+ - name : build import graph
56+ working-directory : Algorithm
57+ run : |
58+ lake exe graph ./.lake/build/doc/algorithm.html
59+
60+ - name : generate docs
61+ working-directory : workaround
62+ run : |
63+ lake build Algorithm:docs
64+ lake build Algorithm:docsHeader
65+
3466 - name : Upload artifact
3567 uses : actions/upload-pages-artifact@v3
3668 with :
37- path : ./.lake/build/doc/
69+ path : ' ./.lake/build/doc'
70+
3871 - name : Deploy to GitHub Pages
3972 if : github.ref == 'refs/heads/master'
4073 id : deployment
4174 uses : actions/deploy-pages@v4
75+
76+ - name : clean up
77+ if : always()
78+ run : |
79+ rm -rf Algorithm
80+ rm -rf $HOME/.elan
81+ rm -rf $HOME/.cache/mathlib
0 commit comments