Skip to content

Docs update for v1.6.0 release #51

Docs update for v1.6.0 release

Docs update for v1.6.0 release #51

name: Generate API Docs
on:
pull_request:
paths:
- "website/public/openapi.json"
jobs:
generate-api-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure the full history is available
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Use the version of Node.js your project requires
- name: Install dependencies
working-directory: website
run: npm ci
- name: Generate API docs
working-directory: website
run: |
rm -rf docs/api/HTTP/*
npm run docusaurus gen-api-docs all
- name: Check for new or modified .mdx files
run: |
if git diff --name-only | grep '\.mdx$'; then
echo "CHANGES_FOUND=true" >> $GITHUB_ENV
else
echo "CHANGES_FOUND=false" >> $GITHUB_ENV
fi
- name: Configure Git user
if: env.CHANGES_FOUND == 'true'
run: |
git config --global user.name 'Spice Schema Bot'
git config --global user.email 'schema-bot@spice.ai'
- name: Commit and push changes
if: env.CHANGES_FOUND == 'true'
working-directory: website
run: |
git add docs/api/HTTP/
git commit -m "chore: update API docs" || exit 0 # Prevent failure if no changes
git pull --rebase origin "${{ github.head_ref }}" # Pull latest changes and rebase
git push origin "HEAD:refs/heads/${{ github.head_ref }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}