Skip to content

Commit 9c83588

Browse files
committed
Add GitHub workflow for documentation
On-behalf-of: SAP <[email protected]> Signed-off-by: Marvin Beckers <[email protected]>
1 parent a4c1a19 commit 9c83588

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Documentation
2+
3+
on:
4+
# So we can trigger manually if needed
5+
workflow_dispatch:
6+
# To confirm any changes to docs build successfully, without deploying them
7+
pull_request:
8+
# Pushes to branches do the full build + deployment
9+
push:
10+
branches:
11+
- main
12+
- "release-*"
13+
paths:
14+
- "docs/**"
15+
- "sdk/apis/**"
16+
- ".github/workflows/docs-gen-and-push.yaml"
17+
18+
permissions:
19+
contents: write
20+
21+
concurrency:
22+
group: ${{ github.workflow }}
23+
24+
jobs:
25+
generate-and-push:
26+
name: Generate and push
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
30+
31+
- run: git fetch origin gh-pages
32+
- run: git fetch origin '+refs/tags/v*:refs/tags/v*' --no-tags
33+
34+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # tag=v5.4.0
35+
with:
36+
go-version: v1.24.3
37+
cache: true
38+
39+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 #tag=v5.5.0
40+
with:
41+
python-version: '3.10'
42+
cache: 'pip'
43+
44+
# mike does not support giving CLI flags for mkdocs, but we also do not
45+
# want to permanently enable strict mode, so here we enable it just for this
46+
# task
47+
- run: |
48+
echo "strict: true" >> docs/mkdocs.yml
49+
50+
- run: make generate-api-docs deploy-docs

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ openshift-goimports: $(OPENSHIFT_GOIMPORTS) ## Download openshift-goimports loca
207207
$(OPENSHIFT_GOIMPORTS):
208208
@GO_MODULE=true hack/download-tool.sh github.com/openshift-eng/openshift-goimports openshift-goimports $(OPENSHIFT_GOIMPORTS_VER)
209209

210-
## Documentation-related targets
210+
##@ Documentation
211211

212212
VENVDIR=$(abspath docs/venv)
213213
REQUIREMENTS_TXT=docs/requirements.txt
@@ -222,4 +222,9 @@ local-docs: venv ## Serve documentation locally.
222222
. $(VENV)/activate; \
223223
VENV=$(VENV) cd docs && mkdocs serve
224224

225+
.PHONY: deploy-docs
226+
deploy-docs: venv ## Deploy documentation (CI make target).
227+
. $(VENV)/activate; \
228+
REMOTE=$(REMOTE) BRANCH=$(BRANCH) docs/scripts/deploy-docs.sh
229+
225230
include Makefile.venv

0 commit comments

Comments
 (0)