Add github action to sync api docs to the user docs site #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Synchronize API Docs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 * * * 1-5' # Mon-Fri every hour | |
push: | |
branches: [chore/docs-action] | |
jobs: | |
build: | |
name: synchronize-api-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
#TODO: Remove before merge | |
ref: chore/docs-action | |
- uses: actions/setup-go@v5 | |
with: | |
cache-dependency-path: | | |
tools/api-docs-generator/go.sum | |
- name: generate | |
working-directory: ./tools/api-docs-generator | |
run: | | |
go run . config.yml ../.. >> "$GITHUB_OUTPUT" | |
- uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "docs: synchronizing api spec with user-docs" | |
title: "Generate API docs from spec" | |
body: | | |
This PR was automatically generated by the API docs synchronization action. Please review the changes and merge if they look good. | |
``` | |
${{ steps.generate.outputs.output }} | |
``` | |
branch: docs/automatic-api-docs-update | |
base: main |