-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (30 loc) · 931 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Update Sitemap
on:
schedule:
- cron: "0 4 * * 0" # Runs every Sunday at 4am UTC
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: pip install requests tqdm
- name: Run sitemap generation script
run: python generate_sitemap.py
- name: Check it was generated
run: ls -l
- name: Commit and push changes
run: |
git config user.name "sitemap-github-actions[bot]"
git config user.email "sitemap-workflow@users.noreply.github.com"
git add sitemap.xml
git commit -m "Update sitemap" || echo "No changes to commit"
git push