Skip to content

Commit 54247e4

Browse files
authored
Create update_sitemap.yml
1 parent 811f521 commit 54247e4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Update Sitemap
2+
3+
on:
4+
schedule:
5+
- cron: "0 4 * * 0" # Runs every Sunday at 4am UTC
6+
workflow_dispatch: # Allow manual trigger
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.12'
23+
24+
- name: Install dependencies
25+
run: pip install requests tqdm
26+
27+
- name: Run sitemap generation script
28+
run: python generate_sitemap.py
29+
30+
- name: Check it was generated
31+
run: ls -l
32+
33+
- name: Commit and push changes
34+
run: |
35+
git config user.name "sitemap-github-actions[bot]"
36+
git config user.email "[email protected]"
37+
git add sitemap.xml sitemap2.xml
38+
git commit -m "Update sitemap" || echo "No changes to commit"
39+
git push

0 commit comments

Comments
 (0)