Skip to content

Delete sitemap.txt

Delete sitemap.txt #3

Workflow file for this run

name: Generate Sitemap
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 0'
# 关键:授予写入仓库的权限
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"
include-hidden: false
- 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 push