⏱️ 3 min read

How To Use gh_docs_bot as Action

This action allows you to build and generate a static website from your Markdown documentation using the custom C++ Static Site Generator (SSG). It encapsulates the entire build process, including dependency installation (LLVM 21, etc.), CMake configuration, and execution.

Inputs

InputDescriptionDefaultRequired
template Path to the HTML template file to use for the site. theme/desktop/template.htmlNo
assets Path to the assets directory to use for the site. theme/blue/assetsNo
output Directory where the generated HTML files will be placed. publicNo
docs Directory containing your source Markdown / HTM files. docsNo
base_pathBase path for the generated sitehttps://zheng-bote.github.io/gha_ghpages/No
tocEnable Table of ContentstrueNo

Example Workflow

Here is a complete example of how to use this action in your own .github/workflows/deploy-docs.yml file. This example builds the site and then deploys it to GitHub Pages.


name: Deploy Documentation

name: Manual gh_docs_bot Build

# Author: Robert Zheng
# created: 2026-01-12
# updated: 2026-01-12
# version: 1.0.0
# description: build and generate static website from markdown files to branch gh-pages

run-name: Manual deploy documentation by ${{ github.actor }}

on:
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build-and-generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: "main"
      - name: Build and Generate Site
        uses: Zheng-Bote/gha_ghpages@main
        with:
          template: 'theme/desktop/fluid_template.html'
          assets: 'theme/fluid/assets'
          output: 'public'
          docs: 'docs'
          base_path: 'https://zheng-bote.github.io/gha_ghpages/'
          toc: true
      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: static-site
          path: public/

      - name: Deploy to gh-pages
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          branch: gh-pages
          folder: public

Prerequisites

Ensure your repository has the following structure: