Commit 7c40449
authored
Update sitemap.yml
name: Generate Sitemap
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 0' # 每周运行一次,可选
workflow_dispatch: # 允许手动触发
permissions:
contents: write # 关键:授予推送代码的权限
jobs:
sitemap:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate sitemap.xml
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://lg-leo.github.io/IG0606ADD-with-CAM-coursebook-NOTE/
# 排除不需要的文件类型(图片、样式等)
exclude-file-extensions: "png,jpg,jpeg,gif,svg,ico,css,js,map,json,webmanifest"
# 排除特定文件夹(如果有)
exclude-paths: "images,assets"
# 是否包含隐藏文件
include-hidden: false
# 是否包含 .md 文件(会转换为 .html 链接)
include-md: true
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add sitemap.xml
git diff --staged --quiet || git commit -m "Auto-generate sitemap"
git push1 parent 91a706c commit 7c40449
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
0 commit comments