Starter workflow templates for building Antora documentation sites with GitHub Actions.
This repository provides two equivalent workflows for building and deploying Antora documentation to GitHub Pages:
| File | Approach | Best For |
|---|---|---|
|
DIY (all steps visible) |
Understanding what’s happening, full control |
|
Reusable action |
Shorter config, standard interface |
Both produce identical results. Choose based on your preference for transparency vs. brevity.
Your repository needs a package.json with Antora as a local dependency:
{
"devDependencies": {
"antora": "^3.1"
}
}The antora package bundles both the CLI and site generator.
Alternatively, you can install them separately:
{
"devDependencies": {
"@antora/cli": "^3.1",
"@antora/site-generator": "^3.1"
}
}Run npm install or pnpm install to generate a lockfile.
|
Warning
|
Do not use global installation ( Global installs lead to unreproducible builds because "latest" resolves to whatever version exists at build time, and there’s no lockfile to ensure consistency.
|
-
Ensure you have a
package.jsonwith Antora dependencies (see above) -
Copy one of the workflow files to your repo’s
.github/workflows/directory -
Rename it (e.g.,
docs.ymlorbuild-and-deploy.yml) -
Update the
playbookpath if yours isn’tantora-playbook.yml -
If you have private content repos, set up credentials (see below)
-
Commit and push to trigger the workflow
If your Antora playbook references private Git repositories, you need to provide credentials.
-
Go to GitHub Token Settings
-
Click "Generate new token" (classic)
-
Give it a descriptive name like "Antora Docs Build"
-
Select the
reposcope (required for private repos) -
Click "Generate token" and copy the token
-
Go to your documentation repo on GitHub
-
Settings → Secrets and variables → Actions
-
Click "New repository secret"
-
Name it (e.g.,
DOCS_PATorMY_GITHUB_PAT) -
Paste your token as the value
-
Click "Add secret"
In diy-workflow.yml, update the GIT_CREDENTIALS environment variable:
env:
GIT_CREDENTIALS: "https://x-access-token:${{ secrets.DOCS_PAT }}@github.com"In action-workflow.yml, update the git_credentials input:
with:
git_credentials: "https://x-access-token:${{ secrets.DOCS_PAT }}@github.com"If your playbook pulls content from both GitHub and GitLab:
# DIY workflow
env:
GIT_CREDENTIALS: |
https://x-access-token:${{ secrets.GITHUB_PAT }}@github.com
https://oauth2:${{ secrets.GITLAB_PAT }}@gitlab.com
# Action workflow
with:
git_credentials: |
https://x-access-token:${{ secrets.GITHUB_PAT }}@github.com
https://oauth2:${{ secrets.GITLAB_PAT }}@gitlab.comThe table below shows how the DIY workflow steps map to action inputs:
| What It Does | DIY Workflow | Action Input |
|---|---|---|
Choose Node.js version |
|
|
Choose Antora version |
|
|
Install extensions |
|
|
Provide credentials |
|
|
Specify playbook |
Argument to |
|
Fetch latest content |
|
|
Set log verbosity |
|
|
Build in subdirectory |
|
|
-
antora-supplemental/antora-build-action — The reusable action used by
action-workflow.yml -
Antora: Publish to GitHub Pages — Official documentation
-
Antora: Private Repository Authentication — Credential formats
MIT License. See LICENSE file.
This is a community-maintained project, not officially affiliated with Antora. The official Antora project is at https://gitlab.com/antora/antora.