-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (57 loc) · 2.34 KB
/
Copy pathpages.yml
File metadata and controls
66 lines (57 loc) · 2.34 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
name: Deploy docs to GitHub Pages
# Publishes every HTML file under docs/ to GitHub Pages and auto-generates
# an index.html linking to each deck. Enables Pages (GitHub Actions source)
# on first run via actions/configure-pages enablement.
on:
push:
branches: [main]
paths:
- 'docs/**.html'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Generate index of HTML decks
run: |
cd docs
{
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">'
echo '<meta name="viewport" content="width=device-width, initial-scale=1">'
echo '<title>Altinity MCP — docs</title>'
echo '<style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0d0f16;color:#e7eaf2;max-width:760px;margin:8vh auto;padding:0 24px}a{color:#ffcc33;text-decoration:none}a:hover{text-decoration:underline}h1{letter-spacing:-.02em}li{margin:.55em 0;font-size:18px}.m{color:#94a0bb;font-size:.85em}code{color:#cfe3ff}</style>'
echo '</head><body><h1>Altinity MCP — docs</h1>'
echo '<p class="m">HTML decks & references published from <code>/docs</code>.</p><ul>'
for f in *.html; do
[ "$f" = "index.html" ] && continue
[ -e "$f" ] || continue
title=$(grep -oiE '<title>[^<]*' "$f" | head -1 | sed -E 's/<title>//I')
[ -z "$title" ] && title="$f"
echo "<li><a href=\"./$f\">$title</a> <span class=\"m\">— $f</span></li>"
done
echo '</ul></body></html>'
} > index.html
echo "::group::generated index.html"; cat index.html; echo "::endgroup::"
- name: Configure Pages (enables Pages on first run)
uses: actions/configure-pages@v5
with:
enablement: true
- name: Upload docs/ as Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4