Skip to content

Commit e3e0b33

Browse files
Jim Ryanvepateljjngxpdabelf5
authored
Add make docs to code gen (#6360)
* test fail make docs * remove make docs build failure * remove -it * make docs ci * add some_docs output * remove extra newline --------- Co-authored-by: Venktesh Shivam Patel <[email protected]> Co-authored-by: Jakub Jarosz <[email protected]> Co-authored-by: Paul Abel <[email protected]>
1 parent 7c62ede commit e3e0b33

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
id-token: write
3636
outputs:
3737
docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
38+
some_docs: ${{ github.event.pull_request && steps.docs.outputs.some_docs == 'true' }}
3839
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
3940
go_path: ${{ steps.vars.outputs.go_path }}
4041
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
@@ -60,12 +61,21 @@ jobs:
6061
id: docs
6162
run: |
6263
files=$(git diff --name-only HEAD^ | egrep -v "^docs/" | egrep -v "^examples/" | egrep -v "^README.md")
64+
docs_files=$(git diff --name-only HEAD^ | grep "^docs/")
6365
if [ -z "$files" ]; then
6466
echo "docs_only=true" >> $GITHUB_OUTPUT
6567
else
6668
echo "docs_only=false" >> $GITHUB_OUTPUT
6769
fi
70+
71+
if [ -n "$docs_files" ]; then
72+
echo "some_docs=true" >> $GITHUB_OUTPUT
73+
else
74+
echo "some_docs=false" >> $GITHUB_OUTPUT
75+
fi
76+
6877
echo $files
78+
echo $docs_files
6979
cat $GITHUB_OUTPUT
7080
shell: bash --noprofile --norc -o pipefail {0}
7181

@@ -164,6 +174,7 @@ jobs:
164174
runs-on: ubuntu-24.04
165175
permissions:
166176
contents: read
177+
needs: checks
167178
steps:
168179
- name: Checkout Repository
169180
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -193,6 +204,10 @@ jobs:
193204
export PATH=$PATH:$(go env GOPATH)/bin
194205
make telemetry-schema && git diff --name-only --exit-code internal/telemetry
195206
207+
- name: Check if make docs builds
208+
if: ${{ needs.checks.outputs.some_docs == 'true' }}
209+
run: cd docs && make docs-ci
210+
196211
unit-tests:
197212
name: Unit Tests
198213
runs-on: ubuntu-24.04

docs/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ else
1212
endif
1313
endif
1414

15+
HUGO_CI=docker run --rm -v ${CURDIR}:/src ${HUGO_IMG} hugo
16+
1517
MARKDOWNLINT?=markdownlint
1618
MARKDOWNLINT_IMG?=ghcr.io/igorshubovych/markdownlint-cli:latest
1719

@@ -39,13 +41,17 @@ endif
3941
docs:
4042
${HUGO}
4143

44+
docs-ci:
45+
${HUGO_CI}
46+
4247
watch:
4348
${HUGO} --bind 0.0.0.0 -p 1313 server --disableFastRender
4449

4550
drafts:
4651
${HUGO} --bind 0.0.0.0 -p 1313 server -D --disableFastRender
4752

4853
clean:
54+
hugo mod clean
4955
[ -d "public" ] && rm -rf "public"
5056

5157
hugo-get:

0 commit comments

Comments
 (0)