Skip to content

Generate Sitemap

Generate Sitemap #239

name: Generate Sitemap
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
push:
branches: [main]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run sitemap generator
run: python .github/scripts/generate-sitemap.py
- name: Commit and push sitemap
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add sitemap.xml
git commit -m "Auto-generate sitemap" || echo "No changes to commit"
git push