Skip to content

Commit bc365b8

Browse files
committed
建立 Pages
1 parent 631a394 commit bc365b8

File tree

2 files changed

+66
-2
lines changed

2 files changed

+66
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
2+
#
3+
name: Deploy site to Pages
4+
5+
on:
6+
push:
7+
branches: [main]
8+
9+
# 允许你从 Actions 选项卡手动运行此工作流程
10+
workflow_dispatch:
11+
12+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
19+
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
20+
concurrency:
21+
group: pages
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# 构建工作
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
33+
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
34+
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
35+
- name: Setup Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
cache: npm # 或 pnpm / yarn
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
42+
- name: Install dependencies
43+
run: npm ci # 或 pnpm install / yarn install / bun install
44+
- name: Build with VitePress
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: npm run build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: dist
52+
53+
# 部署工作
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
needs: build
59+
runs-on: ubuntu-latest
60+
name: Deploy
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "my-vue-app",
2+
"name": "function-plot-gui",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "0.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

0 commit comments

Comments
 (0)