on: push: paths: - "pages/**" - "blog/**" - "sitemap.sh" - "index.xhtml" 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 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