File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Website
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths : ['website/**']
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - uses : actions/setup-node@v4
15+ with :
16+ node-version : 22
17+ cache : ' npm'
18+ cache-dependency-path : website/package-lock.json
19+
20+ - name : Install dependencies and build
21+ run : |
22+ cd website
23+ npm ci
24+ npm run build
25+
26+ - name : Ensure target directory exists
27+ uses : appleboy/ssh-action@v1
28+ with :
29+ host : ${{ secrets.SERVER_HOST }}
30+ username : ${{ secrets.SERVER_USER }}
31+ key : ${{ secrets.SSH_PRIVATE_KEY }}
32+ script : mkdir -p /opt/keban/website
33+
34+ - name : Upload static files to server
35+ uses : appleboy/scp-action@v0.1.7
36+ with :
37+ host : ${{ secrets.SERVER_HOST }}
38+ username : ${{ secrets.SERVER_USER }}
39+ key : ${{ secrets.SSH_PRIVATE_KEY }}
40+ source : website/out/*
41+ target : /opt/keban/website
42+ strip_components : 2
43+ rm : true
44+
45+ - name : Verify deployment
46+ uses : appleboy/ssh-action@v1
47+ with :
48+ host : ${{ secrets.SERVER_HOST }}
49+ username : ${{ secrets.SERVER_USER }}
50+ key : ${{ secrets.SSH_PRIVATE_KEY }}
51+ script : |
52+ sleep 2
53+ curl -sf https://entropydecrease.com/ | grep -q "课伴" || exit 1
Original file line number Diff line number Diff line change 22 "name" : " entropy-decrease" ,
33 "productName" : " Entropy decrease" ,
44 "private" : true ,
5- "version" : " 0.14 .0" ,
5+ "version" : " 0.15 .0" ,
66 "description" : " 熵减 - 跨端学习平台" ,
77 "author" : " Entropy Decrease Team" ,
88 "main" : " dist-electron/electron/main.js" ,
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ services:
145145 volumes :
146146 - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
147147 - ./nginx/certs:/etc/nginx/certs:ro
148+ - /opt/keban/website:/usr/share/nginx/html:ro
148149 depends_on :
149150 - ai-gateway
150151 - sync-service
Original file line number Diff line number Diff line change @@ -120,5 +120,32 @@ http {
120120 proxy_set_header Connection "upgrade" ;
121121 proxy_set_header Host $host ;
122122 }
123+
124+ # -----------------------------------------------------------------
125+ # 官网静态站点(Next.js 静态导出,由 CI 同步至 /opt/keban/website)
126+ # -----------------------------------------------------------------
127+ location / {
128+ root /usr/share/nginx/html;
129+ index index .html;
130+ # Next.js 静态导出生成 story.html 形式,需 $uri.html 回退
131+ try_files $uri $uri .html $uri / =404 ;
132+ error_page 404 /404 .html;
133+ }
134+
135+ # Next.js 静态资源(带 content hash,可长期缓存)
136+ location /_next/static/ {
137+ root /usr/share/nginx/html;
138+ expires 365d ;
139+ add_header Cache-Control "public, immutable" ;
140+ access_log off;
141+ }
142+
143+ # 图片/字体等媒体资源
144+ location ~ * \.(png|jpg|jpeg|gif|ico|svg|webp|woff|woff2|ttf)$ {
145+ root /usr/share/nginx/html;
146+ expires 30d ;
147+ add_header Cache-Control "public" ;
148+ access_log off;
149+ }
123150 }
124151}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { SectionReveal } from "@/components/SectionReveal";
88
99const CHANGELOG = [
1010 {
11- version : "v1.0 .0" ,
11+ version : "v0.15 .0" ,
1212 tag : "正式版" ,
1313 date : "2026-07" ,
1414 highlights : [
@@ -199,7 +199,7 @@ export default function DownloadPage() {
199199 </ span >
200200 < div className = "text-left" >
201201 < h2 className = "font-serif text-xl font-bold text-kb-text" > 课伴 KeBan</ h2 >
202- < p className = "text-xs text-kb-text3" > v1.0 .0 正式版 · 2026-07</ p >
202+ < p className = "text-xs text-kb-text3" > v0.15 .0 正式版 · 2026-07</ p >
203203 </ div >
204204 </ div >
205205
Original file line number Diff line number Diff line change 11{
22 "name" : " website" ,
3- "version" : " 0.1 .0" ,
3+ "version" : " 0.15 .0" ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " next dev" ,
You can’t perform that action at this time.
0 commit comments