-
Notifications
You must be signed in to change notification settings - Fork 56
50 lines (41 loc) · 1.38 KB
/
publish-antora-docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
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_call:
jobs:
publish-antora-docs:
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v3
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@v3
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_call')
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: public/docs
target-folder: docs
commit-message: "ci: publish documentation for ${{ github.sha }}"