This is no longer maintained and no longer the suggested way to generate an Antora site on GitHub Pages. Instead see the updated instructions in the Antora documentation which explain how to automatically use the latest stable version of Antora directly in a GitHub workflow. See the Antora Issue #940 for more details on the change, essentially you only save about 2 seconds by having a custom GitHub Action with Antora installed over installing Antora and NPM as part of the workflow and things are much less prone to future breakage.
The action accepts the following parameters:
-
antora_playbook
— that specifies the Antora playbook path within the repository -
site_sources_path
— the path within$GITHUB_WORKSPACE
from where to run the site generation -
antora_lunr_docsearch_enabled
— Flag for downloading antora docsearch extension from npm
name: "Generate site using antora site action"
uses: bfranske/antora-site-action@master
with:
antora_playbook: antora-playbook.yml
# optional path within the repo, defaults to ${{github.workspace}}
site_sources_path: 'site-sources-folder'
name: "Generate site and Lunr doc search index using antora site action"
uses: bfranske/antora-site-action@master
with:
antora_playbook: antora-playbook.yml
# optional path within the repo, defaults to ${{github.workspace}}
site_sources_path: 'site-sources-folder'
antora_lunr_docsearch_enabled: 'true'
Note, this will only add the lunr extension to the build environment. You must also enable the extension and provide supplemental UI files in your antora playbook.
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
supplemental_files: ./node_modules/@antora/lunr-extension/supplemental_ui
antora:
extensions:
- require: '@antora/lunr-extension'
index_latest_only: true
See the Antor Lunr Extension project for more details.