Skip to content

Commit c00a136

Browse files
feat: automate API specs workflow and documentation (#6786)
* feat: api spec hosting mechanism * fix: trigger condition update on wf file * fix: remove old wf * refact in specs * generate-api-docs.sh fix --------- Co-authored-by: prakhar katiyar <[email protected]> Co-authored-by: prakhar katiyar <[email protected]>
1 parent 08ada30 commit c00a136

File tree

149 files changed

+24068
-21027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+24068
-21027
lines changed

.github/workflows/api-linter.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: API Specs Merger
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'specs/**'
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
lint-bundle-host:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.ref }}
20+
21+
- name: Set up Redocly CLI
22+
run: npm install -g @redocly/cli
23+
24+
- name: Run specs bundling script
25+
working-directory: ${{ github.workspace }}
26+
run: |
27+
chmod +x scripts/generate-api-docs.sh
28+
./scripts/generate-api-docs.sh
29+
30+
- name: Commit and push documentation
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
33+
run: |
34+
git config --local user.email "[email protected]"
35+
git config --local user.name "GitHub Action"
36+
37+
# Fetch the gh-pages branch
38+
git fetch origin gh-pages
39+
40+
# Create a separate worktree for the branch
41+
git worktree add /tmp/gh-pages gh-pages
42+
43+
# Copy generated docs into the worktree
44+
mkdir -p /tmp/gh-pages/docs/api-docs
45+
cp -r docs/api-docs/* /tmp/gh-pages/docs/api-docs/ || true
46+
47+
cd /tmp/gh-pages
48+
49+
git add .
50+
if git diff --staged --quiet; then
51+
echo "✅ No changes to commit"
52+
else
53+
git commit -m "📄 Update API documentation"
54+
git push origin gh-pages
55+
echo "🚀 Documentation pushed to gh-pages branch!"
56+
fi
57+

.github/workflows/build-docs.yaml

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)