-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.2 KB
/
deploy.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
34
35
36
37
38
39
40
41
# .github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
push:
branches:
- main # 监听 main 分支的推送
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.3.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
registry-url: https://registry.npmjs.org/
- name: Build the project
run: |
pnpm install
pnpm build:example
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3 # 一个自动发布github pages的action
with:
publish_branch: gh-pages
publish_dir: ./dist
github_token: ${{ secrets.GAIUS_TOKEN }}
user_name: Gaius-98
user_email: 2388838628@qq.com
allow_empty_commit: true # 允许空提交
# 获取代码提交时的commit message,作为发布gh-pages分支的信息
commit_message: ${{ github.event.head_commit.message }}
full_commit_message: ${{ github.event.head_commit.message }}