mirror of
https://github.com/MervinPraison/PraisonAIUI.git
synced 2026-11-09 11:51:38 -10:00
- Update CI to use 'aiui build' instead of 'mkdocs build' - Add GitHub Pages migration guide docs - Populate .agent/workflows/information.md with project reference - Add GitHub Pages entry to mkdocs.yml nav
3.9 KiB
3.9 KiB
Deploy to GitHub Pages
Ship your AIUI docs site to GitHub Pages with one workflow file.
Quick Start
1. Project Structure
my-project/
├── aiui.template.yaml # Site configuration
├── docs/ # Your markdown content
│ ├── index.md
│ └── guide.md
├── CNAME # Custom domain (optional)
└── .github/
└── workflows/
└── deploy.yml # GitHub Actions workflow
2. Configuration
Create aiui.template.yaml:
schemaVersion: 1
site:
title: "My Docs"
description: "Documentation for my project"
ui: "shadcn"
theme:
preset: "zinc"
darkMode: true
content:
docs:
dir: "./docs"
include:
- "**/*.md"
templates:
docs:
layout: "ThreeColumnLayout"
slots:
header: { ref: "header_main" }
left: { ref: "sidebar_docs" }
main: { type: "DocContent" }
footer: { ref: "footer_main" }
components:
header_main:
type: "Header"
props:
logoText: "My Docs"
footer_main:
type: "Footer"
props:
text: "© 2026"
sidebar_docs:
type: "DocsSidebar"
props:
source: "docs-nav"
routes:
- match: "/docs/**"
template: "docs"
3. GitHub Actions Workflow
Create .github/workflows/deploy.yml:
name: Deploy Docs
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install AIUI
run: pip install aiui
- name: Build
run: |
aiui build --output site --minify
# Preserve custom domain (if using one)
[ -f CNAME ] && cp CNAME site/CNAME
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
4. Enable GitHub Pages
- Go to Settings → Pages in your GitHub repo
- Set Source to
Deploy from a branch - Set Branch to
gh-pages// (root) - Push to
main— your site deploys automatically
Custom Domain
To use a custom domain (e.g., docs.example.com):
- Create a
CNAMEfile in your repo root:docs.example.com - Configure DNS — add a CNAME record pointing to
<username>.github.io - The workflow above automatically copies
CNAMEinto the build output
Migrating from MkDocs
Already using MkDocs? The migration is simple:
| MkDocs | AIUI |
|---|---|
mkdocs.yml |
aiui.template.yaml |
mkdocs build → ./site/ |
aiui build --output site → ./site/ |
mkdocs serve |
aiui serve |
pip install mkdocs-material |
pip install aiui |
Your existing docs/ folder works as-is — just swap the config and build command.
Migration Steps
- Create
aiui.template.yaml(see example above) - Replace
mkdocs buildwithaiui build --output site --minifyin your CI workflow - Remove
mkdocs.yml(optional — keep for reference) - Push to
main
Local Preview
Preview your site before deploying:
# Build and serve locally
aiui build
aiui serve
# Or use dev mode with hot reload
aiui dev
Build Output
aiui build --output site produces:
site/
├── index.html # SPA entry point
├── assets/ # JS + CSS bundles
│ ├── index.js
│ └── index.css
├── ui-config.json # Site configuration manifest
├── docs-nav.json # Navigation tree
├── route-manifest.json # Route definitions
└── docs/ # Markdown content (copied)
├── index.md
└── ...
Everything is static — no server required. GitHub Pages serves it directly.