Repository navigation
82 lines (69 loc) · 2.49 KB
/
Copy path33-update-api-docs.yml
File metadata and controls
82 lines (69 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 33 - update api docs
permissions:
contents: write
pull-requests: write
on:
schedule:
# Run daily at 06:00 UTC
- cron: "0 6 * * *"
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:
jobs:
update-api-docs:
name: Update API reference docs
if: >-
github.event_name != 'pull_request' ||
(github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.head.ref, 'release/') &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: main
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: docs/package.json
- name: Download latest OpenAPI spec
run: curl -sSf "https://cloud.agenta.ai/api/openapi.json" -o docs/docs/reference/openapi.json
- name: Install docs dependencies
working-directory: docs
run: pnpm install --frozen-lockfile
- name: Clean existing generated API docs
working-directory: docs
run: npm run clean-api-docs -- agenta
- name: Regenerate API docs
working-directory: docs
run: npm run gen-api-docs -- agenta
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "docs(api): update API reference from production OpenAPI spec"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: automated/update-api-docs
delete-branch: true
title: "[docs] Update API reference docs"
body: |
Automated daily update of API reference documentation.
This PR was generated by downloading the latest OpenAPI spec from
`https://cloud.agenta.ai/api/openapi.json` and regenerating the
Docusaurus API docs.
**Changes include:**
- `docs/docs/reference/openapi.json` — updated OpenAPI spec
- `docs/docs/reference/api/*.api.mdx` — regenerated endpoint docs
- `docs/docs/reference/api/sidebar.ts` — regenerated sidebar
> If this PR is empty (no file changes), it will not be created.
labels: |
documentation
automated