Skip to content

Commit 4279083

Browse files
committed
feat: 课程表算法可视化项目初始化
- 添加 React + TypeScript + Vite 项目结构 - 实现拓扑排序算法可视化 - 添加 GitHub Actions 自动部署到 GitHub Pages - 添加 Google Analytics 埋点
1 parent 6dd1a8c commit 4279083

37 files changed

+9852
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Run linter
35+
run: npm run lint
36+
37+
- name: Run tests
38+
run: npm run test
39+
40+
- name: Build
41+
run: npm run build
42+
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v4
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: './dist'
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# IDE
8+
.idea/
9+
*.swp
10+
*.swo
11+
.DS_Store
12+
13+
# Logs
14+
*.log
15+
npm-debug.log*
16+
17+
# Environment
18+
.env
19+
.env.local
20+
.env.*.local
21+
22+
# Testing
23+
coverage/
24+
25+
# Vite
26+
*.local

0 commit comments

Comments
 (0)