-
Notifications
You must be signed in to change notification settings - Fork 6
101 lines (93 loc) · 2.63 KB
/
book.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
name: Deploy mdBook to GitHub Pages
on:
# Always build & deploy on push to `dev`
push:
branches:
- dev
pull_request:
branches: [dev]
# Only build if docs are changed
paths:
- "aptos/docs/**"
- "ethereum/docs/**"
- "kadena/docs/**"
merge_group:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@mdbook
- name: Build mdbook
run: |
for book in aptos ethereum kadena; do
echo "Creating ${book} mdbook"
mkdir -p public/${book}
cd ${book}/docs
mdbook build
cp -r book/* ${{ github.workspace }}/public/${book}
cd ${{ github.workspace }}
done
working-directory: ${{ github.workspace }}
- name: Create base page
run: |
cat <<EOF > ./public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZK Light Clients</title>
<style>
body {
display: flex;
justify-content: center;
align-items: baseline;
min-height: 100vh;
margin: 0;
font-family: sans-serif;
background-color: #f0f0f0;
}
h1 {
font-size: 3rem;
margin-bottom: 1rem;
}
li {
font-size: 2rem;
margin: 0.5rem 0;
}
</style>
</head>
<body>
<main class="mdbook">
<h1>ZK Light Clients</h1>
<ul>
<li><a href="./aptos/">Aptos</a></li>
<li><a href="./ethereum/">Ethereum</a></li>
<li><a href="./kadena/">Kadena</a></li>
</ul>
</main>
</body>
</html>
EOF
working-directory: ${{ github.workspace }}
- name: Upload build artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
retention-days: 1
deploy:
needs: build
if: github.ref_name == 'dev' && github.event_name == 'push'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4