-
Notifications
You must be signed in to change notification settings - Fork 28
162 lines (134 loc) · 4.21 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
on:
push:
branches:
- main
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# allow write to manipulate cache
actions: write
jobs:
build_blueprint:
runs-on: ubuntu-latest
name: Build blueprint
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip' # cache pip dependencies
- name: Update pip
run: |
pip install --upgrade pip
- name: Install blueprint apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y graphviz libgraphviz-dev pdf2svg dvisvgm
- name: Install blueprint dependencies
run: |
cd blueprint && pip install -r requirements.txt
- name: Build blueprint and copy to `docs/blueprint`
run: |
make blueprint
mkdir -p docs
mv blueprint/web docs/
- name: Clear previously saved cache
uses: DareFox/delete-cache-by-key@v1.0.1
with:
key: Blueprint-cache
mode: exact
continue-on-error: true
- name: Save blueprint for future use
uses: actions/cache/save@v4
with:
path: |
docs/web
key: Blueprint-cache
- name: Restore previous documentation, while we wait for the next one to be generated
uses: actions/cache/restore@v4
with:
path: |
docs/docs
key: Documentation-cache
continue-on-error: true
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload blueprint artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
# generate doc after blueprint (as it's quite a bit longer)
build_docs:
runs-on: ubuntu-latest
name: Build docs
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain $(cat lean-toolchain)
- name: Build project
run: make LAKEBIN='~/.elan/bin/lake' build
- name: Cache mathlib docs
uses: actions/cache@v3
with:
path: |
.lake/build/doc/Init
.lake/build/doc/Lake
.lake/build/doc/Lean
.lake/build/doc/Std
.lake/build/doc/Mathlib
.lake/build/doc/declarations
!.lake/build/doc/declarations/declaration-data-PrimeNumberTheoremAnd*
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
restore-keys: |
MathlibDoc-
- name: Build documentation
run: make LAKEBIN='~/.elan/bin/lake' doc
- name: Copy documentation to `docs/docs`
run: |
mkdir -p docs
cp -r .lake/build/doc docs/docs
- name: Clear previously saved cache
uses: DareFox/delete-cache-by-key@v1.0.1
with:
key: Documentation-cache
mode: exact
continue-on-error: true
- name: Save documentation for future use
uses: actions/cache/save@v4
with:
path: |
docs/docs
key: Documentation-cache
#- name: Download blueprint artifacts
# uses: actions/download-artifact@v3
# with:
# path: blueprint_artifacts
#
#- name: Extract blueprint artifacts
# run: tar xvf blueprint_artifacts/github-pages/artifact.tar -C docs/
- name: Restore previously generated blueprint
uses: actions/cache/restore@v4
with:
path: |
docs/web
key: Blueprint-cache
continue-on-error: true
- name: Upload docs & blueprint artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3