-
-
Notifications
You must be signed in to change notification settings - Fork 212
132 lines (115 loc) · 4.41 KB
/
docs.yml
File metadata and controls
132 lines (115 loc) · 4.41 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
name: Deploy website + docs
on:
push:
branches: [main]
paths:
- 'website-static/**'
- 'docs/**'
- 'marketing/**'
- 'llms.txt'
- 'CHANGELOG.md'
- 'MIGRATION.md'
- 'CONTRIBUTING.md'
release:
types: [published]
workflow_call:
workflow_dispatch:
# Allow only one concurrent deployment, skip in-progress runs
concurrency:
group: pages
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build website + docs
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
# ── 1. Copy static website (marketing site — root) ─────────────────
- name: Assemble site root from static HTML
run: |
mkdir -p site
# Static HTML/CSS/JS landing page
cp -r website-static/* site/
touch site/.nojekyll
# ── 2. Build MkDocs (technical docs — /docs/) ───────────────────────
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install MkDocs
run: |
pip install mkdocs-material
# mkdocs-material[imaging] enables social card previews (optional, needs Cairo)
pip install "mkdocs-material[imaging]" 2>/dev/null || true
- name: Sync content into docs
run: |
if [ -d marketing/codelabs ]; then
mkdir -p docs/docs/codelabs
cp marketing/codelabs/codelab-3d-compose.md docs/docs/codelabs/codelab-3d-compose.md 2>/dev/null || true
cp marketing/codelabs/codelab-ar-compose.md docs/docs/codelabs/codelab-ar-compose.md 2>/dev/null || true
fi
cp MIGRATION.md docs/docs/migration.md 2>/dev/null || true
cp CHANGELOG.md docs/docs/changelog.md 2>/dev/null || true
cp CONTRIBUTING.md docs/docs/contributing.md 2>/dev/null || true
- name: Build MkDocs
run: |
cd docs
mkdocs build --site-dir ../site/docs
# ── 3. Copy extra files ─────────────────────────────────────────────
- name: Copy SEO and meta files
run: |
# Copy SEO files from docs if not in website-static
for f in CNAME llms.txt llms-full.txt; do
[ ! -f "site/$f" ] && [ -f "docs/docs/$f" ] && cp "docs/docs/$f" "site/$f" || true
done
# Root llms.txt
[ ! -f "site/llms.txt" ] && [ -f "llms.txt" ] && cp llms.txt site/ || true
# ── 4. Include Dokka API docs if available ──────────────────────────
- name: Download Dokka API docs (if available)
uses: actions/download-artifact@v8
with:
name: dokka-api-docs
path: site/api/sceneview
continue-on-error: true
# ── 5. Verify and upload ────────────────────────────────────────────
- name: Verify build
run: |
FILE_COUNT=$(find site -type f | wc -l)
echo "Site contains $FILE_COUNT files"
echo "Root files: $(ls site/)"
echo "Has index.html: $([ -f site/index.html ] && echo YES || echo NO)"
echo "Has docs/: $([ -d site/docs ] && echo YES || echo NO)"
if [ "$FILE_COUNT" -lt 10 ]; then
echo "ERROR: Site build produced fewer than 10 files. Aborting."
exit 1
fi
if [ ! -f site/index.html ]; then
echo "ERROR: No index.html in root. Static site copy may have failed."
exit 1
fi
- name: Configure Pages
uses: actions/configure-pages@v6
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
# Retry once if a concurrent deployment caused a conflict
- name: Retry deploy (if first attempt failed)
if: failure()
uses: actions/deploy-pages@v5