Skip to content

Generate Sitemap

Generate Sitemap #153

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