Generate Sitemap #153
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 Sitemap | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Process Metadata Submission"] | |
| types: | |
| - completed | |
| branches: | |
| - 'main' | |
| push: | |
| paths: | |
| - "JsonFiles/**" | |
| schedule: | |
| - cron: "0 0 * * 1" # Weekly job to regenerate sitemap | |
| jobs: | |
| build: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| - name: Generate sitemap | |
| run: python generate_sitemap.py | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name "GitHub Actions Bot" | |
| git config --global user.email "actions@github.com" | |
| git add sitemap.xml | |
| git commit -m "Update sitemap.xml" | |
| git push |