Skip to content

Commit e80cf8e

Browse files
committed
CI/CD
1 parent 845ab49 commit e80cf8e

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: "22"
24+
cache: "yarn"
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Type check
30+
run: yarn type-check
31+
32+
- name: Lint
33+
run: yarn lint
34+
35+
- name: Build
36+
run: yarn docs:build

.github/workflows/deploy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# 部署到 GitHub Pages
2+
name: Deploy to GitHub Pages
3+
4+
on:
5+
# 仅手动触发
6+
workflow_dispatch:
7+
8+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# 允许一个并发部署
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: "22"
34+
cache: "yarn"
35+
36+
- name: Install dependencies
37+
run: yarn install --frozen-lockfile
38+
39+
- name: Type check
40+
run: yarn type-check
41+
42+
- name: Lint
43+
run: yarn lint
44+
45+
- name: Build
46+
run: yarn docs:build
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: "./dist"
55+
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules/
2-
website/
2+
dist/
33
docs/.vitepress/cache
44
.DS_Store
55
.eslintcache

0 commit comments

Comments
 (0)