Delete sitemap.txt #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |