| | |

GitHub Pages 10 ๐Ÿ“„ Documentation & Report Portals โ€” Publishing Docusaurus, VitePress, MkDocs, Storybook, and CI coverage reports

โฑ๏ธ Estimated read: 10 min | |

Modern software engineering requires more than just source code; it requires comprehensive documentation and observability. Documentation engines like Docusaurus and VitePress provide the narrative for developers, while Storybook provides a visual catalog for UI components, and coverage reports provide an objective view of code health. GitHub Pages has become the industry-standard hosting layer for these auxiliary artifacts because they are inherently static and tightly coupled with the repository’s lifecycle.

Using GitHub Pages for documentation and reports transforms a repository from a code silo into a transparent development portal. Instead of documentation living in a README or a separate wiki, it lives as a high-performance, searchable website that is automatically updated every time code is merged. This ensures that the “live” documentation never drifts from the actual state of the software. Furthermore, hosting test coverage and performance reports on GitHub Pages allows stakeholders to verify quality without needing access to specialized CI runner outputs.

This chapter covers the specialized configuration and deployment strategies for the most popular documentation frameworks and report generators. We will explore how to manage the unique build requirements of Docusaurus and VitePress, how to host MkDocs for Python-centric projects, and how to set up a multi-path deployment strategy that allows Storybook and test coverage reports to coexist alongside your main documentation.

Key point: GitHub Pages is the optimal hosting solution for documentation and CI reports because it supports the static-export outputs of Docusaurus, MkDocs, and Storybook, allowing for automated, version-controlled documentation portals that update via GitHub Actions.


Why X exists

1. The Information Gap problem.

Code alone rarely explains “why” or “how” to integrate. Documentation portals like Docusaurus exist to bridge this gap, providing a structured way to present tutorials, API references, and conceptual guides that are more accessible than raw source code or basic Markdown files.

2. The Maintenance overhead.

Self-hosting documentation often requires a dedicated server, database, and maintenance schedule. Static site documentation removes this overhead. By using GitHub Pages, the infrastructure is managed by GitHub, leaving the development team to focus solely on the content and the build pipeline.

3. The Consistency problem.

Documentation often becomes outdated the moment it is written. By integrating documentation builds into the CI/CD pipeline, the documentation is treated like code. If a pull request changes an API, the documentation is updated as part of the same transaction, ensuring the two remain in sync.

4. The Visibility of health.

Test coverage reports and Storybook instances are often buried inside CI logs or local development environments. Hosting these on GitHub Pages makes them “first-class citizens” of the project, allowing any team member to browse the UI component library or check the test coverage of a specific branch.

5. The Scalability trade-off.

Dynamic documentation sites (like Wikis) become slow and complex as they grow. Static documentation generators provide near-instant page loads and high searchability (via tools like Algolia) while remaining simple to deploy. This “Jamstack” approach is the most efficient way to scale developer resources.

6. The Searchability benefit.

Modern SSGs like VitePress and Docusaurus generate highly optimized HTML that is easily indexed by search engines. This makes it easier for external developers to find your project’s documentation through search, which is critical for open-source adoption and developer advocacy.


a. Docusaurus and VitePress: The Frontend Documentation Giants

Docusaurus (React-based) and VitePress (Vue/Vite-based) are the dominant players in developer documentation. Both frameworks emphasize a “Markdown-first” approach while allowing developers to embed interactive components.

Docusaurus requires a docusaurus.config.js update to handle GitHub Pages sub-paths. Since most projects are hosted at /repo-name/, the url and baseUrl must be configured correctly to prevent broken CSS/JS links.

// docusaurus.config.js
module.exports = {
  title: 'My Project',
  url: 'https://username.github.io',
  baseUrl: '/my-repo-name/', // Crucial: include leading and trailing slashes
  onBrokenLinks: 'throw',
  projectName: 'my-repo-name',
  organizationName: 'username',
  trailingSlash: false,
};

VitePress is significantly faster due to Vite. Its configuration lives in .vitepress/config.js. Like Docusaurus, the base property is the most critical setting for successful deployment.

// .vitepress/config.js
export default {
  title: "My Docs",
  base: "/my-repo-name/", // Base path for GitHub Pages
  themeConfig: {
    nav: [{ text: "Home", link: "/" }],
    sidebar: [{ text: "Guide", items: [{ text: "Intro", link: "/intro" }] }]
  }
}

Both frameworks produce a static folder (build for Docusaurus, .vitepress/dist for VitePress) that is then uploaded via actions/upload-pages-artifact.


b. MkDocs and Storybook: Python Docs and UI Libraries

MkDocs is the standard for Python projects, using the popular “Material for MkDocs” theme. It is configured via a single mkdocs.yml file. Unlike Node-based tools, MkDocs requires a Python environment in your GitHub Actions.

# mkdocs.yml
site_name: My Project Docs
site_url: https://username.github.io/my-repo-name/
theme:
  name: material

Storybook is used to document UI components in isolation. It is often deployed as a standalone site or as a subdirectory of the main documentation. To deploy Storybook, you run the build-storybook command, which generates a storybook-static folder.

- name: Build Storybook
  run: npm run build-storybook
- name: Upload Storybook
  uses: actions/upload-pages-artifact@v3
  with:
    path: 'storybook-static'

If you want to host both Docusaurus and Storybook, you can use a build script to move the Storybook output into a sub-folder of the Docusaurus build (e.g., build/storybook) before the final upload step.


c. CI Reports and Code Coverage

Hosting test coverage reports (generated by Vitest, Jest, or Istanbul) allows for easy review of code quality. These reports are usually generated as a folder of HTML files.

In a typical Vitest setup, you can generate a coverage folder:

# Example command in CI
npx vitest run --coverage

To make these reports accessible, your GitHub Action can move the coverage output into your documentation’s build folder. This allows you to visit username.github.io/repo/coverage/ to see the line-by-line breakdown.

- name: Generate Coverage
  run: npm run coverage
- name: Move Coverage to Docs
  run: mv coverage/ ./dist/coverage
- name: Upload Combined Artifact
  uses: actions/upload-pages-artifact@v3
  with:
    path: './dist'

Important: Because coverage reports and documentation engines often use folders starting with underscores (like _next or _assets), you should ensure a .nojekyll file is present in the root of your deployment artifact to prevent GitHub’s legacy Jekyll engine from ignoring those files.


Complete Example Session

# ============================================
# PART 1: THE MULTI-DOC WORKFLOW
# ============================================
name: Deploy Project Portal
on:
  push:
    branches: ["main"]

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # ============================================
      # PART 2: SETUP ENVIRONMENTS
      # ============================================
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'

      # ============================================
      # PART 3: BUILD MAIN DOCUMENTATION (Docusaurus)
      # ============================================
      - name: Install Dependencies
        run: npm ci

      - name: Build Docusaurus
        run: npm run build # Outputs to ./build

      # ============================================
      # PART 4: BUILD STORYBOOK (UI Docs)
      # ============================================
      - name: Build Storybook
        run: npm run build-storybook # Outputs to ./storybook-static

      # ============================================
      # PART 5: RUN TESTS & COVERAGE
      # ============================================
      - name: Run Tests
        run: npm run test:coverage # Outputs to ./coverage

      # ============================================
      # PART 6: COMBINE ARTIFACTS
      # ============================================
      - name: Merge Reports into Docs
        run: |
          mkdir -p build/storybook
          mkdir -p build/coverage
          cp -r storybook-static/* build/storybook/
          cp -r coverage/* build/coverage/
          touch build/.nojekyll

      # ============================================
      # PART 7: UPLOAD COMBINED PORTAL
      # ============================================
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: './build'

      # ============================================
      # PART 8: DEPLOY TO PAGES
      # ============================================
      - name: Deploy
        uses: actions/deploy-pages@v4

# ============================================
# PART 9: THE MKDOCS ALTERNATIVE (Python)
# ============================================
# - uses: actions/setup-python@v5
# - run: pip install mkdocs-material
# - run: mkdocs build

# ============================================
# PART 10: VERIFICATION
# ============================================
# Main site: user.github.io/repo/
# Storybook: user.github.io/repo/storybook/
# Coverage:  user.github.io/repo/coverage/

This workflow demonstrates the “Portal” pattern, where multiple specialized documentation and report tools are merged into a single static deployment.


Quick Reference

Tool Output Directories

ToolDefault FolderCommand
Docusaurusbuildnpm run build
VitePress.vitepress/distnpm run docs:build
MkDocssitemkdocs build
Storybookstorybook-staticnpm run build-storybook
Vitest/Jestcoveragenpm run test:coverage

Base Path Settings

ToolConfig KeyFormat
DocusaurusbaseUrl'/repo-name/'
VitePressbase'/repo-name/'
MkDocssite_url'https://.../repo/'
Storybook--deployment-url'.../storybook/'

Comparison: Docusaurus vs VitePress

FeatureDocusaurusVitePress
Base TechReactVue / Vite
SpeedFastExtremely Fast
VersioningNative SupportManual / Simple
Use CaseComplex DocsSimple/Clean Docs

Best Practices

โœ… Do This:

// Always include leading and trailing slashes in base
baseUrl: '/my-project/'                                       // โœ…

// Use .nojekyll to ensure underscore folders are served
touch build/.nojekyll                                         // โœ…

// Combine reports into subfolders of your main docs
cp -r coverage build/coverage                                 // โœ…

// Set 'onBrokenLinks' to 'throw' in Docusaurus
onBrokenLinks: 'throw'                                        // โœ…

โŒ Don’t Do This:

// Don't hardcode absolute URLs in Markdown
[Link](/docs/intro)                                           // โŒ

// Don't commit build folders (build/, dist/, site/)
// (Add them to .gitignore)                                    // โŒ

// Don't use the 'Implicit' Jekyll engine for docs
// (Use GitHub Actions instead)                                // โŒ

// Don't forget to set 'trailingSlash: false' in Docusaurus
// (Avoids SEO/canonical issues on Pages)                     // โŒ

Common Pitfalls

PitfallWhy It HappensFix
Broken StylesbaseUrl missing repo nameUpdate config with /repo-name/
Missing AssetsJekyll ignores underscore foldersAdd .nojekyll file
404 on RefreshSPA routing mismatchUse HashRouting or 404.html hack
Slow BuildLarge images in docsUse framework-specific image plugins
Build Fail (Node)npm install vs npm ciUse npm ci for consistent CI builds
MkDocs CSS failsite_url is incorrectMatch site_url exactly to Pages URL

Real-World Examples

1. Docusaurus Config

const config = { baseUrl: '/awesome-lib/' };

2. VitePress Base

export default { base: '/docs/' };

3. Storybook Subfolder Build

npm run build-storybook -o ./build/storybook

4. Vitest Coverage Command

vitest run --coverage --reporter=html

5. MkDocs Material Install

pip install mkdocs-material mkdocs-git-revision-date-plugin

6. Nojekyll Creation

- run: touch ./dist/.nojekyll

7. GitHub Actions Perms

permissions: { pages: write, id-token: write }

8. MkDocs Build

mkdocs build --clean

9. Conditional Base URL

const baseUrl = process.env.GITHUB_ACTIONS ? '/repo/' : '/';

10. Combination Script

mkdir -p dist && cp -r docs/* dist/ && cp -r coverage dist/

Visual

The Documentation Portal Structure

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ GITHUB PAGES ROOT (/repo-name/)                           โ”‚
โ”‚                                                           โ”‚
โ”‚ โ”œโ”€โ”€ index.html (Main Docs - Docusaurus/VitePress)         โ”‚
โ”‚ โ”œโ”€โ”€ .nojekyll                                             โ”‚
โ”‚ โ”œโ”€โ”€ assets/                                               โ”‚
โ”‚ โ”‚                                                         โ”‚
โ”‚ โ”œโ”€โ”€ storybook/ (UI Components)                            โ”‚
โ”‚ โ”‚   โ””โ”€โ”€ index.html                                        โ”‚
โ”‚ โ”‚                                                         โ”‚
โ”‚ โ””โ”€โ”€ coverage/ (Test Reports)                              โ”‚
โ”‚     โ””โ”€โ”€ index.html                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Build & Merge Pipeline

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ DOCS BUILDโ”‚      โ”‚STORYBOOK  โ”‚      โ”‚ COVERAGE  โ”‚
โ”‚ (Node)    โ”‚      โ”‚ (Node)    โ”‚      โ”‚ (Vitest)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚                  โ”‚                  โ”‚
      โ–ผ                  โ–ผ                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ./build   โ”‚      โ”‚ ./sb-dist โ”‚      โ”‚ ./cov-distโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚                  โ”‚                  โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ MERGE STEP โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
                   โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ ./final-artifact        โ”‚
        โ”‚ (Upload to GitHub Pages)โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Asset Path Resolution

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ BASE URL LOGIC                                            โ”‚
โ”‚                                                           โ”‚
โ”‚ Config: base = "/my-repo/"                                โ”‚
โ”‚                                                           โ”‚
โ”‚ Source: <img src="/logo.png">                             โ”‚
โ”‚ Render: <img src="/my-repo/logo.png">                     โ”‚
โ”‚                                                           โ”‚
โ”‚ (Ensures assets load correctly on GitHub's sub-domains)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
React EngineDocusaurus
Vue/Vite EngineVitePress
Python EngineMkDocs (Material)
Component DocsStorybook
Health ReportsCode Coverage (HTML)
Critical Flag.nojekyll
Sub-path KeybaseUrl or base

Key takeaways:

  • GitHub Pages is a portal host. It is not just for one site; you can host documentation, component libraries, and test reports in a single, unified directory structure.
  • baseUrl is the common point of failure. Documentation engines default to root hosting. You must configure them to understand the repository sub-path.
  • OIDC makes deployment secure. Use the permissions block in GitHub Actions to avoid manual secrets and leverage GitHub’s native identity for deployment.
  • Storybook belongs with your docs. Providing a live Storybook instance alongside documentation allows developers to interact with UI components before using them.
  • Visibility improves quality. Hosting coverage reports on GitHub Pages makes code health visible to the entire team, encouraging better testing habits.
  • Never forget .nojekyll. Modern tools use underscore-prefixed folders (like _next or _assets). Without .nojekyll, GitHub Pages will hide these, breaking your site.

Remember: A high-quality software project is defined by the ease with which others can understand and verify it. By automating the publication of Docusaurus, Storybook, and coverage reports to GitHub Pages, you create a professional-grade documentation portal that serves as a single source of truth for developers and stakeholders alike.

Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!