-
-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (32 loc) · 1.01 KB
/
sitemap-generation.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
name: Generate sitemap
on:
push:
branches: [ main ]
paths: [ '**.html' ]
jobs:
sitemap:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://actions.cicirello.org/
- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: Commit and push
run: |
if [[ `git status --porcelain sitemap.xml` ]]; then
git config --global user.name 'Vincent A. Cicirello'
git config --global user.email 'cicirello@users.noreply.github.com'
git add sitemap.xml
git commit -m "Automated sitemap update" sitemap.xml
git push
fi