Caller Setup¶
Add documentation publishing to any repo by creating a GitHub Actions workflow that calls folio's reusable workflow.
Prerequisites¶
- A GCS bucket configured for folio (see GCP Setup)
- Workload Identity Federation configured for GitHub Actions
- An mkdocs project with dependencies in
pyproject.toml
GitHub Configuration¶
Add these to your repo's Settings > Secrets and variables > Actions:
Secrets:
GCP_WIF_PROVIDER— Workload Identity Federation provider pathGCP_SA_EMAIL— CI service account email
Variables:
GCS_BUCKET— Target GCS bucket name
Workflow File¶
Create .github/workflows/publish.yml in your repo:
name: Publish Docs
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'pyproject.toml'
workflow_dispatch:
jobs:
publish:
uses: charliek/folio/.github/workflows/publish-docs.yml@main
with:
gcs-bucket: ${{ vars.GCS_BUCKET }}
secrets:
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WIF_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SA_EMAIL }}
Project Setup¶
Your repo needs a pyproject.toml with mkdocs dependencies:
[project]
name = "my-project-docs"
version = "0.1.0"
requires-python = ">=3.13"
[dependency-groups]
docs = [
"mkdocs>=1.6.1",
"mkdocs-material>=9.6.14",
"pymdown-extensions>=10.15",
]
And an mkdocs.yml:
site_name: my-project
site_description: 'Short description for the repo index'
docs_dir: docs
site_dir: site-build
dev_addr: '127.0.0.1:7070'
theme:
name: material
Key conventions:
site_dir: site-build(not the defaultsite/)site_descriptionis used in_meta.jsonfor the repo indexdev_addron port 7070
Workflow Inputs¶
| Input | Description | Default |
|---|---|---|
gcs-bucket |
Target GCS bucket | (required) |
repo-name |
Path under /repos/ |
Repository name |
docs-dir |
Directory containing mkdocs.yml |
. |
python-version |
Python version for uv | 3.13 |
docs-group |
uv dependency group | docs |
site-dir |
Build output directory | site-build |
description |
Override for _meta.json description |
site_description from mkdocs.yml |
What the Workflow Publishes¶
The reusable workflow:
- Builds the mkdocs site
- Writes
_meta.jsonwith repo metadata (name, description, timestamp, GitHub link) - Syncs the built site to
gs://{bucket}/repos/{repo-name}/
The _meta.json file is read by the folio server's /_api/repos endpoint to populate the repo index.
Starter Template¶
See examples/caller-workflow.yml in the folio repo for a complete example.