-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (51 loc) · 1.34 KB
/
github-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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 发布站点
name: github-pages
# 什么时候运行?
on:
# 当主分支(master)有新提交且 src/docs/ 目录下文件有改动时运行
push:
branches:
- 'master'
paths:
- 'src/options/**'
- 'src/player/**'
# 也可以在 GitHub Actions 手动运行
workflow_dispatch:
# 执行什么操作
jobs:
deploy:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
steps:
# 检出存储库以供工作流访问
- name: Checkout
uses: actions/checkout@v4
# 配置站点数据
- name: Setup Pages
uses: actions/configure-pages@v5
# 安装 node.js
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'latest'
# 更新 npm 依赖
- name: Update npm
run: npm update
# 生成网页资源
- name: Build and release
run: npm run build
# 上传网页资源(位于 /dist/options/ 目录)
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist/options/'
# 部署网页
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4