Update config.json #4
This file contains 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 Index | |
on: | |
push: | |
branches: | |
- main # or your default branch name | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
generate-api-index: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' # Adjust this version if needed | |
- name: Install dependencies | |
run: | | |
cd docs/api-index/generate-api-index | |
npm install | |
- name: Generate API Index | |
run: | | |
cd docs/api-index/generate-api-index | |
node generate.js | |
- name: Move generated files | |
run: | | |
mv docs/api-index/generate-api-index/output/* docs/api-index/ | |
- name: Commit and push if changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add docs/api-index/* | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update API Index" && git push) |