publish-antora-docs #629
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "publish-antora-docs" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "version.txt" # Trigger a build when the version changes in order to take the version tag into account | |
schedule: | |
# Every day at 3:00 AM in order to generate documentation for every module that had a new release | |
- cron: "0 3 * * *" | |
pull_request: | |
paths: | |
- "docs/**" | |
workflow_dispatch: | |
jobs: | |
publish-antora-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out repository" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all branches and tags | |
- name: "Build documentation with Antora" | |
uses: docker://ghcr.io/camptocamp/devops-stack-antora:v3 | |
with: | |
args: generate antora-playbook.yml --to-dir public/docs | |
- name: "Upload generated artifact" | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: documentation | |
path: ${{ github.workspace }}/public/docs | |
- name: "Deploy documentation to GitHub Pages" | |
if: github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: public/docs | |
target-folder: docs | |
commit-message: "ci: publish documentation for ${{ github.sha }}" |