Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): add workflow to generate documentation on PR merge #12681

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
10 changes: 4 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"
virajbhartiya marked this conversation as resolved.
Show resolved Hide resolved
- uses: ./.github/actions/install-system-dependencies
- uses: ./.github/actions/install-go
- uses: ./.github/actions/make-deps
- run: make gen
- run: git diff --exit-code
- run: make docsgen-cli
- run: git diff --exit-code
check-lint:
name: Check (lint-all)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"
- uses: ./.github/actions/install-system-dependencies
- uses: ./.github/actions/install-go
- uses: ./.github/actions/make-deps
Expand All @@ -52,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"
- uses: ./.github/actions/install-go
- run: go fmt ./...
- run: git diff --exit-code
Expand All @@ -62,7 +60,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
submodules: "recursive"
- uses: ./.github/actions/install-go
- run: go mod tidy -v
- run: git diff --exit-code
34 changes: 34 additions & 0 deletions .github/workflows/docsgen-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Generate Documentation

virajbhartiya marked this conversation as resolved.
Show resolved Hide resolved
permissions:
contents: write

on:
pull_request:
types: [closed]
branches:
- master

jobs:
generate-docs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate documentation
run: make docsgen-cli

- name: Commit and push generated docs
run: |
if [ -n "$(git status --porcelain)" ]; then
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git add .
git commit --amend --no-edit
git push --force
else
echo "No changes to commit"
fi