Skip to content

misc: Added Github Actions for linting and building api specs #6720

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

Merged
merged 5 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/api-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint API Specs
on:
pull_request:
paths:
- 'specs/swagger/**'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install Redocly CLI
run: npm install -g @redocly/cli
- name: Lint OpenAPI specification
run: |
cd specs/swagger
echo "Linting OpenAPI specification..."
redocly lint openapi.yaml
env:
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: OpenAPI Build Documentation
on:
push:
branches:
- main
paths:
- 'specs/swagger/**'
permissions:
contents: write
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install Redocly CLI
run: npm install -g @redocly/cli

- name: Switch to gh-pages branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo "Switching to gh-pages branch..."
git checkout -b gh-pages
git fetch origin gh-pages
git pull --rebase origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
- name: Build OpenAPI documentation
run: |
cd specs/swagger
echo "Building OpenAPI documentation..."
redocly build-docs openapi.yaml --output=openapi.html
echo "Documentation built successfully!"

- name: Commit and push documentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo "Committing and pushing documentation..."
git add specs/swagger/openapi.html
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update OpenAPI documentation from main branch"
git push --force origin gh-pages
echo "Documentation pushed to gh-pages branch!"
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
Loading