1name: Generate API Docs
2
3on:
4 pull_request:
5 paths:
6 - "spiceaidocs/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
16 - name: Set up Node.js
17 uses: actions/setup-node@v3
18 with:
19 node-version: "16" # Use the version of Node.js your project requires
20
21 - name: Install dependencies
22 run: npm ci
23
24 - name: Generate API docs
25 working-directory: spiceaidocs
26 run: |
27 rm docs/api/HTTP/*
28 npm run docusaurus gen-api-docs all
29
30 - name: Check for new or modified .mdx files
31 run: |
32 if git diff --name-only | grep '\.mdx$'; then
33 echo "New or modified .mdx files detected. Committing changes."
34 else
35 echo "No changes to .mdx files. Skipping commit."
36 exit 0
37 fi
38
39 - name: Configure Git user
40 run: |
41 git config --global user.name 'Spice Schema Bot'
42 git config --global user.email 'schema-bot@spice.ai'
43
44 - name: Commit changes
45 run: |
46 git add *.mdx
47 git commit -m "chore: update API docs"
48
49 - name: Push changes
50 run: |
51 git push origin "HEAD:refs/heads/${{ github.head_ref }}"
52 env:
53 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54
1name: Generate API Docs
2
3on:
4 pull_request:
5 paths:
6 - "spiceaidocs/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
16 - name: Set up Node.js
17 uses: actions/setup-node@v3
18 with:
19 node-version: "16" # Use the version of Node.js your project requires
20
21 - name: Install dependencies
22 run: npm ci
23
24 - name: Generate API docs
25 working-directory: spiceaidocs
26 run: |
27 rm docs/api/HTTP/*
28 npm run docusaurus gen-api-docs all
29
30 - name: Check for new or modified .mdx files
31 run: |
32 if git diff --name-only | grep '\.mdx$'; then
33 echo "New or modified .mdx files detected. Committing changes."
34 else
35 echo "No changes to .mdx files. Skipping commit."
36 exit 0
37 fi
38
39 - name: Configure Git user
40 run: |
41 git config --global user.name 'Spice Schema Bot'
42 git config --global user.email 'schema-bot@spice.ai'
43
44 - name: Commit changes
45 run: |
46 git add *.mdx
47 git commit -m "chore: update API docs"
48
49 - name: Push changes
50 run: |
51 git push origin "HEAD:refs/heads/${{ github.head_ref }}"
52 env:
53 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54