增加广州系列 #92
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: Hexo Deploy | |
| on: | |
| push: | |
| branches: | |
| - main # 只有推送至 main 分支时才触发 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true # 如果你的主题是 git submodule 引入的,必须加这行 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # 建议使用 LTS 版本 | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Clean | |
| run: npx hexo clean | |
| - name: Generate | |
| run: npm run build # 对应 hexo generate | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} # 自动获取,无需配置 | |
| publish_dir: ./public # 部署 public 文件夹下的内容 | |
| publish_branch: gh-pages # 指定部署到哪个分支 |