主要参考
步骤
博客目录创建git仓库,推送至source分支
| git init git add . git commit git branch -M source git push origin source
|
更改.github/workflows/pages.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| name: Pages
on: push: branches: - source
jobs: pages: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v1 with: node-version: '12.x' - name: Cache NPM dependencies uses: actions/cache@v2 with: path: node_modules key: ${{ runner.OS }}-npm-cache restore-keys: | ${{ runner.OS }}-npm-cache - name: Install Dependencies run: npm install - name: Build run: npm run build - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public publish_branch: master
|
注意一下分支名字即可。
更改项目Github Pages的源目录
在项目的Settings
页的Pages
标签里,将源目录改为master
,保存就好了。
其他参考
这两个是Fluid主题给的教程,但是不太看得懂到底部署到哪儿去了,最后没有用。