HelpLogin
© 2022-2025 Spice AI, Inc.
SQL Query ReferenceDocsFAQSupport
PrivacyTerms
Status
Home
Datasets
Models
trunk
Edit on GitHub
Fork
/docs/.github/workflows/updated_openapi.yml
1name: Generate API Docs
2
3on:
4 pull_request:
5 paths:
6 - "website/public/openapi.json"
7
8jobs:
9 generate-api-docs:
10 runs-on: ubuntu-latest
11
12 steps:
13 - name: Checkout repository
14 uses: actions/checkout@v3
15 with:
16 fetch-depth: 0 # Ensure the full history is available
17
18 - name: Set up Node.js
19 uses: actions/setup-node@v3
20 with:
21 node-version: '18' # Use the version of Node.js your project requires
22
23 - name: Install dependencies
24 working-directory: website
25 run: npm ci
26
27 - name: Generate API docs
28 working-directory: website
29 run: |
30 rm -rf docs/api/HTTP/*
31 npm run docusaurus gen-api-docs all
32
33 - name: Check for new or modified .mdx files
34 run: |
35 if git diff --name-only | grep '\.mdx$'; then
36 echo "CHANGES_FOUND=true" >> $GITHUB_ENV
37 else
38 echo "CHANGES_FOUND=false" >> $GITHUB_ENV
39 fi
40
41 - name: Configure Git user
42 if: env.CHANGES_FOUND == 'true'
43 run: |
44 git config --global user.name 'Spice Schema Bot'
45 git config --global user.email 'schema-bot@spice.ai'
46
47 - name: Commit and push changes
48 if: env.CHANGES_FOUND == 'true'
49 working-directory: website
50 run: |
51 git add docs/api/HTTP/
52 git commit -m "chore: update API docs" || exit 0 # Prevent failure if no changes
53 git pull --rebase origin "${{ github.head_ref }}" # Pull latest changes and rebase
54 git push origin "HEAD:refs/heads/${{ github.head_ref }}"
55 env:
56 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57
1name: Generate API Docs
2
3on:
4 pull_request:
5 paths:
6 - "website/public/openapi.json"
7
8jobs:
9 generate-api-docs:
10 runs-on: ubuntu-latest
11
12 steps:
13 - name: Checkout repository
14 uses: actions/checkout@v3
15 with:
16 fetch-depth: 0 # Ensure the full history is available
17
18 - name: Set up Node.js
19 uses: actions/setup-node@v3
20 with:
21 node-version: '18' # Use the version of Node.js your project requires
22
23 - name: Install dependencies
24 working-directory: website
25 run: npm ci
26
27 - name: Generate API docs
28 working-directory: website
29 run: |
30 rm -rf docs/api/HTTP/*
31 npm run docusaurus gen-api-docs all
32
33 - name: Check for new or modified .mdx files
34 run: |
35 if git diff --name-only | grep '\.mdx$'; then
36 echo "CHANGES_FOUND=true" >> $GITHUB_ENV
37 else
38 echo "CHANGES_FOUND=false" >> $GITHUB_ENV
39 fi
40
41 - name: Configure Git user
42 if: env.CHANGES_FOUND == 'true'
43 run: |
44 git config --global user.name 'Spice Schema Bot'
45 git config --global user.email 'schema-bot@spice.ai'
46
47 - name: Commit and push changes
48 if: env.CHANGES_FOUND == 'true'
49 working-directory: website
50 run: |
51 git add docs/api/HTTP/
52 git commit -m "chore: update API docs" || exit 0 # Prevent failure if no changes
53 git pull --rebase origin "${{ github.head_ref }}" # Pull latest changes and rebase
54 git push origin "HEAD:refs/heads/${{ github.head_ref }}"
55 env:
56 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57