Skip to content

Commit 10bd834

Browse files
feat: add Starlight docs site and screenshot CI
- Scaffold docs/ with Astro + Starlight (teal theme, Kore branding) - Landing page with hero, screenshot showcase, feature grid, install cards - Content pages: installation, quick-start, 6 feature guides, 2 reference pages - Playwright screenshot capture: 41 pages + panels, full Tauri IPC mock - screenshots.yml: generates screenshots artifact on main push - deploy-docs.yml: builds docs with screenshots → deploys to gh-pages - @types/node added for Playwright test Node.js APIs - screenshots/ and screenshot-report/ added to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4a48bfa commit 10bd834

28 files changed

Lines changed: 7455 additions & 36 deletions

.github/workflows/deploy-docs.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
# Rebuild docs when content, config, or screenshots spec changes
8+
- 'docs/**'
9+
- 'tests/screenshots/**'
10+
- '.github/workflows/deploy-docs.yml'
11+
# Also rebuild whenever the screenshots workflow finishes successfully
12+
# so the docs always show the latest captures.
13+
workflow_run:
14+
workflows: ['Generate Screenshots']
15+
types: [completed]
16+
branches: [main]
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: deploy-docs
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build-and-deploy:
25+
name: Build Starlight & deploy to gh-pages
26+
# Skip if triggered by a failed screenshots run
27+
if: >
28+
github.event_name != 'workflow_run' ||
29+
github.event.workflow_run.conclusion == 'success'
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 20
32+
33+
permissions:
34+
contents: write # needed by peaceiris/actions-gh-pages
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
# ── Screenshots ────────────────────────────────────────────────────────
41+
- name: Download screenshots artifact (from screenshots workflow)
42+
if: github.event_name == 'workflow_run'
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: app-screenshots
46+
# Artifacts belong to the triggering workflow run
47+
run-id: ${{ github.event.workflow_run.id }}
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
path: screenshots/
50+
continue-on-error: true # Don't fail if no artifact yet
51+
52+
- name: Download latest screenshots artifact (direct push / manual)
53+
if: github.event_name != 'workflow_run'
54+
uses: dawidd6/action-download-artifact@v9
55+
with:
56+
workflow: screenshots.yml
57+
branch: main
58+
name: app-screenshots
59+
path: screenshots/
60+
if_no_artifact_found: warn # First deploy may have no artifact
61+
continue-on-error: true
62+
63+
- name: Copy screenshots into docs public directory
64+
run: |
65+
if [ -d screenshots ] && [ "$(ls -A screenshots)" ]; then
66+
mkdir -p docs/public/screenshots
67+
cp -r screenshots/. docs/public/screenshots/
68+
echo "✓ Copied $(ls screenshots | wc -l | tr -d ' ') screenshots"
69+
else
70+
echo "⚠ No screenshots found — docs will build without them"
71+
mkdir -p docs/public/screenshots
72+
fi
73+
74+
# ── Docs build ─────────────────────────────────────────────────────────
75+
- name: Setup pnpm
76+
uses: pnpm/action-setup@v4
77+
with:
78+
version: 10
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: '20'
84+
cache: 'pnpm'
85+
cache-dependency-path: docs/pnpm-lock.yaml
86+
87+
- name: Install docs dependencies
88+
working-directory: docs
89+
run: pnpm install --frozen-lockfile
90+
91+
- name: Build Starlight docs
92+
working-directory: docs
93+
run: pnpm build
94+
95+
# ── Preserve update.json from existing gh-pages ───────────────────────
96+
# The release workflow (release.yml) pushes update.json to gh-pages for
97+
# Tauri's auto-updater. We include it in this deploy so it isn't clobbered.
98+
- name: Preserve update.json
99+
run: |
100+
curl -sf \
101+
"https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/update.json" \
102+
-o docs/dist/update.json \
103+
|| echo '{}' > docs/dist/update.json
104+
echo "✓ update.json preserved"
105+
106+
# ── Deploy ──────────────────────────────────────────────────────────────
107+
- name: Deploy to gh-pages
108+
uses: peaceiris/actions-gh-pages@v4
109+
with:
110+
github_token: ${{ secrets.GITHUB_TOKEN }}
111+
publish_dir: ./docs/dist
112+
publish_branch: gh-pages
113+
# Single orphan commit keeps gh-pages history clean.
114+
# update.json is included in docs/dist above.
115+
force_orphan: true
116+
commit_message: 'docs: deploy ${{ github.sha }}'
117+
user_name: 'github-actions[bot]'
118+
user_email: 'github-actions[bot]@users.noreply.github.com'

.github/workflows/screenshots.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Generate Screenshots
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
# Re-run when the app UI or mock data changes
8+
- 'src/**'
9+
- 'tests/screenshots/**'
10+
- 'package.json'
11+
- 'pnpm-lock.yaml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
screenshots:
16+
name: Capture app screenshots
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 10
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
cache: 'pnpm'
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Cache Playwright browsers
39+
uses: actions/cache@v4
40+
id: pw-cache
41+
with:
42+
path: ~/.cache/ms-playwright
43+
key: playwright-chromium-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
44+
45+
- name: Install Playwright Chromium
46+
if: steps.pw-cache.outputs.cache-hit != 'true'
47+
run: pnpm exec playwright install chromium --with-deps
48+
49+
- name: Install Chromium system deps (cached hit)
50+
if: steps.pw-cache.outputs.cache-hit == 'true'
51+
run: pnpm exec playwright install-deps chromium
52+
53+
- name: Capture screenshots
54+
run: pnpm screenshots
55+
56+
- name: Upload screenshots artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: app-screenshots
60+
path: screenshots/
61+
retention-days: 90
62+
if-no-files-found: error

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ test-results/
1616
/update.json
1717
/gh-pages-update/
1818

19+
# Playwright screenshots — generated locally by `pnpm screenshots`
20+
# and injected into the docs site by CI. Never commit these.
21+
/screenshots/
22+
/screenshot-report/
23+
1924
# Dolt database files (added by bd init)
2025
.dolt/
2126
*.db

docs/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist/
2+
.astro/
3+
node_modules/
4+
5+
# Screenshots are generated by CI and injected at build time.
6+
# Run `pnpm screenshots` from the project root, then
7+
# `cp -r ../screenshots public/screenshots` to preview locally.
8+
public/screenshots/

docs/astro.config.mjs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config'
3+
import starlight from '@astrojs/starlight'
4+
5+
export default defineConfig({
6+
site: 'https://devtheops.github.io',
7+
base: '/kore',
8+
integrations: [
9+
starlight({
10+
title: 'Kore',
11+
description:
12+
'Kubernetes Orchestration and Resource Explorer — a lightweight, open-source desktop IDE for managing Kubernetes clusters.',
13+
logo: {
14+
light: './src/assets/brand/logo-light.svg',
15+
dark: './src/assets/brand/logo-dark.svg',
16+
replacesTitle: false,
17+
},
18+
social: [
19+
{
20+
icon: 'github',
21+
label: 'GitHub',
22+
href: 'https://github.com/DEVtheOPS/kore',
23+
},
24+
],
25+
sidebar: [
26+
{
27+
label: 'Getting Started',
28+
items: [
29+
{ label: 'Installation', slug: 'getting-started/installation' },
30+
{ label: 'Quick Start', slug: 'getting-started/quick-start' },
31+
],
32+
},
33+
{
34+
label: 'Features',
35+
items: [
36+
{ label: 'Cluster Management', slug: 'features/cluster-management' },
37+
{ label: 'Workloads', slug: 'features/workloads' },
38+
{ label: 'Helm', slug: 'features/helm' },
39+
{ label: 'RBAC', slug: 'features/rbac' },
40+
{ label: 'Storage', slug: 'features/storage' },
41+
{ label: 'Networking', slug: 'features/networking' },
42+
],
43+
},
44+
{
45+
label: 'Reference',
46+
items: [
47+
{ label: 'Supported Resources', slug: 'reference/supported-resources' },
48+
{ label: 'Keyboard Shortcuts', slug: 'reference/keyboard-shortcuts' },
49+
],
50+
},
51+
],
52+
customCss: ['./src/styles/custom.css'],
53+
editLink: {
54+
baseUrl: 'https://github.com/DEVtheOPS/kore/edit/main/docs/',
55+
},
56+
}),
57+
],
58+
})

docs/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "kore-docs",
3+
"type": "module",
4+
"version": "0.1.1",
5+
"private": true,
6+
"scripts": {
7+
"dev": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/starlight": "^0.33.0",
14+
"astro": "^5.0.0",
15+
"sharp": "^0.33.5"
16+
}
17+
}

0 commit comments

Comments
 (0)