GitHub Pages: orionna319.github.io/blog
具体参考 GitHub Actions 入门教程-阮一峰,结合了一下,说一说自己踩的一些坑。
一、创建 Repositories 时选择 Public
一定要选 Public,要不然在 GitHub Pages,选不了主题。
二、ci.yml 参考 GitHub Pages Deploy Action
name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
token: ${{ secrets.ACCESS_TOKEN }}
三、Choose Theme(P1),选中之后,在 Actions(P2)可以看到(此时访问你的 homepage 就可以啦)
-
P1
-
P2