-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.13 KB
/
update-openapi-docs.yml
File metadata and controls
49 lines (39 loc) · 1.13 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
name: Update OpenAPI Docs
on:
push:
branches: [ "main", "develop" ]
paths:
- "docs/openapi.yaml"
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Install Redocly CLI
run: npm install -g @redocly/cli
- name: Build OpenAPI docs
working-directory: docs
run: |
npx @redocly/cli build-docs openapi.yaml -o index.html
- name: Commit & Push updated docs (only on push, not PR)
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add docs/index.html
# Only commit and push if there are changes
if ! git diff --cached --quiet; then
git commit -m "chore: update openapi docs"
git push origin ${GITHUB_REF#refs/heads/}
else
echo "No changes to commit."
fi