File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate Sitemap
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ schedule :
6
+ - cron : ' 0 12 * * *'
7
+
8
+ jobs :
9
+ generate-sitemap :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Setup Node.js
17
+ uses : actions/setup-node@v4
18
+ with :
19
+ node-version : ' 20'
20
+
21
+ - name : Install dependencies
22
+ run : npm install -g sitemap-generator-cli
23
+
24
+ - name : Generate sitemap
25
+ run : |
26
+ SITE_URL="https://docs.sei.io"
27
+
28
+ # Generate the sitemap
29
+ npx sitemap-generator-cli $SITE_URL --filepath ./sitemap.xml --maxDepth 10 --ignoreHreflang true
30
+
31
+ - name : Check for changes
32
+ id : git-check
33
+ run : |
34
+ git diff --quiet sitemap.xml || echo "changes=true" >> $GITHUB_OUTPUT
35
+
36
+ - name : Commit and push changes
37
+ if : steps.git-check.outputs.changes == 'true'
38
+ run : |
39
+ git config --local user.email "action@github.com"
40
+ git config --local user.name "GitHub Action"
41
+ git add sitemap.xml
42
+ git commit -m "Update sitemap.xml"
43
+ git push
You can’t perform that action at this time.
0 commit comments