Update API version to 1.7.0-unstable #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' && !startsWith(github.head_ref, 'release/') | |
| 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 }} |