src: update the README #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: Deploy Hugo to Public Branch | |
| on: | |
| push: | |
| branches: [ "master" ] # 监听main分支的推送 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout master | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # 递归拉取主题子模块 | |
| fetch-depth: 0 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: "0.143.1" # 指定Hugo版本 | |
| extended: true # 若主题依赖扩展版则需启用 | |
| - name: Build Static Site | |
| run: hugo # 构建 | |
| - name: Generate CNAME file | |
| run: echo "codebearjourney.top" > public/CNAME # 绑定域名 | |
| - name: Deploy to Public Branch | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| personal_token: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
| publish_branch: public # 目标分支名称 | |
| publish_dir: ./public # Hugo生成的静态文件目录 | |
| external_repository: tianyuxbear/tianyuxbear.github.io # 发布仓库名(若跨仓库需填写) | |
| force_orphan: true # 强制清空目标分支历史(可选) |