-
Notifications
You must be signed in to change notification settings - Fork 0
310 lines (261 loc) Β· 10.4 KB
/
Copy pathgithub-pages.yml
File metadata and controls
310 lines (261 loc) Β· 10.4 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
paths:
- 'README.md'
- 'docs/**'
- '.github/workflows/github-pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install markdown processor
run: |
npm install -g marked
npm install -g marked-gfm-heading-id
npm install -g marked-highlight
- name: Convert README to HTML
run: |
cat > convert.js << 'EOF'
const fs = require('fs');
const { marked } = require('marked');
const { gfmHeadingId } = require('marked-gfm-heading-id');
const { markedHighlight } = require('marked-highlight');
const hljs = require('highlight.js');
marked.use(gfmHeadingId());
marked.use(markedHighlight({
langPrefix: 'hljs language-',
highlight(code, lang) {
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
return hljs.highlight(code, { language }).value;
}
}));
const readme = fs.readFileSync('README.md', 'utf8');
// Convert README content
const content = marked(readme);
// Create full HTML page
const html = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wind Turbine Data Pipeline - Aerolake</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
<style>
:root {
--primary: #2563eb;
--primary-dark: #1e40af;
--text: #1e293b;
--text-muted: #64748b;
--bg: #ffffff;
--bg-secondary: #f8fafc;
--border: #e2e8f0;
--code-bg: #1e293b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
line-height: 1.6;
color: var(--text);
background: var(--bg-secondary);
min-height: 100vh;
.container {
max-width: 1400px;
margin: 0 auto;
background: var(--bg);
}
.header-banner {
background: var(--bg);
border-bottom: 3px solid var(--primary);
padding: 40px;
text-align: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.header-banner h1 {
font-size: 2.5em;
margin-bottom: 10px;
color: var(--text);
}
.header-banner p {
font-size: 1.2em;
color: var(--text-muted);
}
.nav-links {
background: var(--bg-secondary);
padding: 20px;
text-align: center;
border-bottom: 1px solid var(--border);
}
.nav-links a {
display: inline-block;
padding: 10px 20px;
margin: 5px;
background: var(--primary);
color: white;
text-decoration: none;
border-radius: 4px;
transition: background 0.2s;
}
.nav-links a:hover {
background: var(--primary-dark);
}
.content {
padding: 40px;
}
h1, h2, h3, h4, h5, h6 {
color: var(--text);
margin: 30px 0 15px 0;
}
h1 { border-bottom: 2px solid var(--primary); padding-bottom: 10px; }
h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
pre {
background: var(--code-bg);
color: #e2e8f0;
padding: 20px;
border-radius: 5px;
overflow-x: auto;
margin: 20px 0;
}
code {
background: var(--code-bg);
color: #48bb78;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
}
pre code {
background: transparent;
padding: 0;
}
blockquote {
border-left: 4px solid var(--primary);
padding-left: 20px;
margin: 20px 0;
color: #718096;
background: var(--bg);
padding: 20px;
border-radius: 5px;
}
ul, ol {
margin: 15px 0;
padding-left: 30px;
}
li {
margin: 8px 0;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
th, td {
border: 1px solid #e2e8f0;
padding: 12px;
text-align: left;
}
th {
background: var(--bg);
font-weight: 600;
}
tr:nth-child(even) {
background: #f8fafc;
}
a {
color: var(--primary);
text-decoration: none;
transition: color 0.3s;
}
a:hover {
color: var(--secondary);
text-decoration: underline;
}
.footer {
background: var(--bg);
padding: 30px;
text-align: center;
border-top: 1px solid #e2e8f0;
color: #718096;
}
.mermaid {
background: white;
padding: 20px;
border-radius: 5px;
margin: 20px 0;
}
@media (max-width: 768px) {
.header-banner h1 {
font-size: 1.8em;
}
.content {
padding: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header-banner">
<h1>π¬οΈ Aerolake Wind Turbine Data Pipeline</h1>
<p>Environmental Sensor Data Processing with Databricks & Bacalhau</p>
</div>
<div class="nav-links">
<a href="https://aerolake.org/schemas/viewer.html">π Schema Viewer</a>
<a href="https://aerolake.org/schemas/wind-turbine-v1.json">π JSON Schema</a>
<a href="https://github.com/aerolake/databricks-wind-turbines">π GitHub</a>
<a href="https://aerolake.org/schemas/">π Schema Docs</a>
</div>
<div class="content">
${content}
</div>
<div class="footer">
<p>Wind Turbine Data Pipeline | Auto-generated from README.md</p>
<p>Last updated: ${new Date().toISOString()}</p>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
</body>
</html>`;
fs.writeFileSync('docs/index.html', html);
console.log('β
Converted README.md to docs/index.html');
EOF
npm install marked marked-gfm-heading-id marked-highlight highlight.js
node convert.js
- name: Move schema documentation
run: |
# Keep schemas in subdirectory
mkdir -p docs/schemas
# Schema files are already in docs/schemas from the repo
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4