Add sitemap CI/CD

Signed-off-by: Arija A. <ari@ari.lt>
This commit is contained in:
2025-10-14 17:17:56 +03:00
parent 2ab022ca2c
commit cdba088540
2 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
on:
push:
paths:
- "pages/**"
- "sitemap.sh"
jobs:
stats:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Set up repository
id: check_commit
run: |
git reset --hard
git pull
git reset --hard
- name: Generate sitemap
run: |
sh ./sitemap.sh
- name: Stage the changes
run: |
git add sitemap.xml
- name: Commit and Push Changes
run: |
if git diff --staged --quiet; then
echo "No changes to commit."
else
git config --local user.email "sitemap@localhost"
git config --local user.name "Sitemap CI/CD"
git commit -am "[skip ci] Update sitemap" || echo "No changes to commit"
git push origin HEAD -f
fi