fix: make split-branch build workflow executable #111
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: 自动部署 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - content | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| TZ: Asia/Shanghai | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| steps: | |
| - name: 检查 master 分支 | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: master | |
| fetch-depth: 0 | |
| - name: 安装 Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22.x" | |
| - name: 启用 Corepack (激活 Yarn 4) | |
| run: corepack enable | |
| - name: 拉取内容分支 | |
| run: git fetch origin content:refs/remotes/origin/content | |
| - name: 导入内容 | |
| run: ./tools/import-content-branch.sh origin/content | |
| - name: 安装 Anzhiyu 主题 | |
| run: ./tools/prepare-anzhiyu-theme.sh | |
| - name: 安装项目依赖 | |
| run: | | |
| # 这一步会根据新的 package.json 安装所有东西 | |
| # 包括:hexo核心、渲染器(pug/stylus)、gulp、bangumi插件 | |
| yarn install --immutable | |
| - name: 生成静态文件 | |
| run: | | |
| npx hexo clean | |
| npx hexo bangumi -u | |
| npx hexo generate | |
| # 如果以后需要 gulp,取消注释即可,不需要再安装 gulp-cli | |
| # npx gulp | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| publish_branch: gh-pages |