fix: 修复 104 期 Markdown 语法格式并更新 README #10
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 HTML & RSS from MD Files | |
| # 触发条件:push 到 main 分支,MD 文件变更时触发 | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. 拉取仓库代码 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2. 设置 Python 环境 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| # 3. 手动安装依赖 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install markdown pygments # pygments 用于代码块高亮 | |
| # 4. 运行脚本生成HTML和RSS | |
| - name: Generate HTML and RSS files | |
| run: | | |
| python scripts/generate_rss.py | |
| # 5. 提交并推送生成的文件(包含HTML和RSS) | |
| - name: Commit and push generated files | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: auto-generate HTML files and rss.xml" | |
| file_pattern: "asset/html/*.html rss.xml" # 提交HTML目录和RSS文件 | |
| branch: main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |