Generate Docs Data #144
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 Docs Data | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'C/**' | |
| - 'Csharp/**' | |
| - 'Cpp/**' | |
| - 'Go/**' | |
| - 'Html/**' | |
| - 'Java/**' | |
| - 'Javascript/**' | |
| - 'PHP/**' | |
| - 'Python/**' | |
| - 'Rust/**' | |
| - 'typescript/**' | |
| - 'docs/scripts/generate_site_data.py' | |
| - 'docs/index.html' | |
| workflow_dispatch: # Allow manual triggering | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| generate_data: | |
| runs-on: ubuntu-latest | |
| # Skip if commit message contains [skip ci] or [ci skip] | |
| if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')" | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: echo "No Python dependencies to install beyond standard library" | |
| - name: Generate site data | |
| run: python docs/scripts/generate_site_data.py | |
| - name: Commit and push if changed | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add docs/site_data.json | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit." | |
| else | |
| git commit -m "docs: Update site_data.json [skip ci]" | |
| git push | |
| fi |