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: Update Project Index (Commit Only) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**/*.html' | |
| - '**/*.py' | |
| - '**/*.js' | |
| - '**/*.mjs' | |
| - 'generate_index.py' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate-index: | |
| runs-on: ubuntu-latest | |
| 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.11' | |
| - name: Generate index.html | |
| run: | | |
| python generate_index.py | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| git diff --quiet index.html || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit and push if changed | |
| if: steps.check_changes.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add index.html | |
| git commit -m "🤖 Auto-update project index [skip ci]" | |
| git push | |
| - name: Summary | |
| run: | | |
| echo "## 🎉 Index Generation Complete!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "The project index has been updated successfully." >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ steps.check_changes.outputs.changed }}" == "true" ]; then | |
| echo "✅ Changes detected and committed" >> $GITHUB_STEP_SUMMARY | |
| echo "📝 The deploy-pages workflow will now deploy to GitHub Pages" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "ℹ️ No changes detected" >> $GITHUB_STEP_SUMMARY | |
| fi |