Skip to content

Commit

Permalink
Add make docs to code gen (#6360)
Browse files Browse the repository at this point in the history
* 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 <ve.patel@f5.com>
Co-authored-by: Jakub Jarosz <99677300+jjngx@users.noreply.github.com>
Co-authored-by: Paul Abel <128620221+pdabelf5@users.noreply.github.com>
  • Loading branch information
4 people authored Sep 10, 2024
1 parent 7c62ede commit e3e0b33
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
id-token: write
outputs:
docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
some_docs: ${{ github.event.pull_request && steps.docs.outputs.some_docs == 'true' }}
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
go_path: ${{ steps.vars.outputs.go_path }}
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
Expand All @@ -60,12 +61,21 @@ jobs:
id: docs
run: |
files=$(git diff --name-only HEAD^ | egrep -v "^docs/" | egrep -v "^examples/" | egrep -v "^README.md")
docs_files=$(git diff --name-only HEAD^ | grep "^docs/")
if [ -z "$files" ]; then
echo "docs_only=true" >> $GITHUB_OUTPUT
else
echo "docs_only=false" >> $GITHUB_OUTPUT
fi
if [ -n "$docs_files" ]; then
echo "some_docs=true" >> $GITHUB_OUTPUT
else
echo "some_docs=false" >> $GITHUB_OUTPUT
fi
echo $files
echo $docs_files
cat $GITHUB_OUTPUT
shell: bash --noprofile --norc -o pipefail {0}

Expand Down Expand Up @@ -164,6 +174,7 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: read
needs: checks
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -193,6 +204,10 @@ jobs:
export PATH=$PATH:$(go env GOPATH)/bin
make telemetry-schema && git diff --name-only --exit-code internal/telemetry
- name: Check if make docs builds
if: ${{ needs.checks.outputs.some_docs == 'true' }}
run: cd docs && make docs-ci

unit-tests:
name: Unit Tests
runs-on: ubuntu-24.04
Expand Down
6 changes: 6 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ else
endif
endif

HUGO_CI=docker run --rm -v ${CURDIR}:/src ${HUGO_IMG} hugo

MARKDOWNLINT?=markdownlint
MARKDOWNLINT_IMG?=ghcr.io/igorshubovych/markdownlint-cli:latest

Expand Down Expand Up @@ -39,13 +41,17 @@ endif
docs:
${HUGO}

docs-ci:
${HUGO_CI}

watch:
${HUGO} --bind 0.0.0.0 -p 1313 server --disableFastRender

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

clean:
hugo mod clean
[ -d "public" ] && rm -rf "public"

hugo-get:
Expand Down

0 comments on commit e3e0b33

Please sign in to comment.