Skip to content

Commit a5a3c8c

Browse files
committed
Fix build
1 parent a2b9a6a commit a5a3c8c

25 files changed

+102
-574
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,56 +29,30 @@ jobs:
2929
build:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v6
34-
- name: Detect package manager
35-
id: detect-package-manager
36-
run: |
37-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
38-
echo "manager=yarn" >> $GITHUB_OUTPUT
39-
echo "command=install" >> $GITHUB_OUTPUT
40-
echo "runner=yarn" >> $GITHUB_OUTPUT
41-
exit 0
42-
elif [ -f "${{ github.workspace }}/package.json" ]; then
43-
echo "manager=npm" >> $GITHUB_OUTPUT
44-
echo "command=ci" >> $GITHUB_OUTPUT
45-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46-
exit 0
47-
else
48-
echo "Unable to determine package manager"
49-
exit 1
50-
fi
51-
- name: Setup Node
52-
uses: actions/setup-node@v4
53-
with:
54-
node-version: "24"
55-
cache: ${{ steps.detect-package-manager.outputs.manager }}
56-
- name: Setup Pages
57-
uses: actions/configure-pages@v5
58-
with:
59-
# Automatically inject basePath in your Next.js configuration file and disable
60-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61-
#
62-
# You may remove this line if you want to manage the configuration yourself.
63-
static_site_generator: next
64-
- name: Restore cache
65-
uses: actions/cache@v4
66-
with:
67-
path: |
68-
.next/cache
69-
# Generate a new cache whenever packages or source files change.
70-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
71-
# If source files changed but packages didn't, rebuild from a prior cache.
72-
restore-keys: |
73-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
74-
- name: Install dependencies
75-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
76-
- name: Build with Next.js
77-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
78-
- name: Upload artifact
79-
uses: actions/upload-pages-artifact@v3
80-
with:
81-
path: ./out
32+
- uses: actions/checkout@v6
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10
36+
- uses: actions/setup-node@v6
37+
with:
38+
node-version: '24.x'
39+
cache: 'pnpm'
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
with:
43+
# Automatically inject basePath in your Next.js configuration file and disable
44+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
45+
#
46+
# You may remove this line if you want to manage the configuration yourself.
47+
static_site_generator: next
48+
- run: pnpm install --frozen-lockfile
49+
- run: pnpm next build
50+
env:
51+
ASSET_PREFIX: /${{ github.event.repository.name }}
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: ./out
8256

8357
# Deployment job
8458
deploy:
@@ -88,6 +62,6 @@ jobs:
8862
runs-on: ubuntu-latest
8963
needs: build
9064
steps:
91-
- name: Deploy to GitHub Pages
92-
id: deployment
93-
uses: actions/deploy-pages@v4
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ pnpm preview
6262
- 進入 Settings > Pages
6363
- Source 選擇 "GitHub Actions"
6464

65-
2. 如果部署到子路徑(如 `username.github.io/yindian-manus/`),需要設置環境變數:
65+
2. 如果部署到子路徑(如 `username.github.io/yindian/`),需要設置環境變數:
6666
-`.github/workflows/deploy.yml` 中的 Build 步驟添加:
6767
```yaml
6868
- name: Build
6969
run: pnpm build
7070
env:
7171
NODE_ENV: production
72-
BASE_PATH: /yindian-manus/ # 修改為你的倉庫名稱
72+
BASE_PATH: /yindian/ # 修改為你的倉庫名稱
7373
```
7474
7575
3. 如果部署到根域名(如 `yindian.example.com`),不需要設置 BASE_PATH,預設為 `/`
@@ -78,7 +78,7 @@ pnpm preview
7878

7979
```bash
8080
# 構建(子路徑部署)
81-
BASE_PATH=/yindian-manus/ pnpm build
81+
BASE_PATH=/yindian/ pnpm build
8282
8383
# 構建(根域名部署)
8484
pnpm build
@@ -88,7 +88,7 @@ pnpm build
8888

8989
## GitHub 仓庫
9090

91-
- **前端**: https://github.com/nk2028/yindian-manus
91+
- **前端**: https://github.com/nk2028/yindian
9292
- **后端**: https://github.com/nk2028/yindian-server
9393

9494
## 相關項目
@@ -107,7 +107,7 @@ pnpm build
107107

108108
## 反饋問題
109109

110-
- 在 https://github.com/nk2028/yindian-manus/issues 開 issue
110+
- 在 https://github.com/nk2028/yindian/issues 開 issue
111111
- Telegram 群組: https://t.me/nk2028
112112
- 發送電郵至: support@nk2028.shn.hk
113113
- QQ 找綾香

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { NextConfig } from "next";
33
const nextConfig: NextConfig = {
44
/* config options here */
55
reactCompiler: true,
6+
basePath: '/yindian',
67
};
78

89
export default nextConfig;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"react": "19.2.3",
1818
"react-dom": "19.2.3",
1919
"sonner": "^2.0.7",
20-
"tailwind-merge": "^3.4.0",
21-
"wouter": "^3.9.0"
20+
"tailwind-merge": "^3.4.0"
2221
},
2322
"devDependencies": {
2423
"@tailwindcss/postcss": "^4",

pnpm-lock.yaml

Lines changed: 0 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/fonts.css

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,64 @@
22
@font-face {
33
font-family: 'Charis SIL';
44
src: local('Charis SIL'),
5-
url('/fonts/CharisSIL/CharisSIL-Regular.woff2') format('woff2'),
6-
url('/fonts/CharisSIL/CharisSIL-Regular.ttf') format('truetype');
5+
url('/yindian/fonts/CharisSIL/CharisSIL-Regular.woff2') format('woff2'),
6+
url('/yindian/fonts/CharisSIL/CharisSIL-Regular.ttf') format('truetype');
77
font-weight: normal;
88
font-style: normal;
99
}
1010

1111
@font-face {
1212
font-family: 'Charis SIL';
1313
src: local('Charis SIL Italic'),
14-
url('/fonts/CharisSIL/CharisSIL-Italic.woff2') format('woff2'),
15-
url('/fonts/CharisSIL/CharisSIL-Italic.ttf') format('truetype');
14+
url('/yindian/fonts/CharisSIL/CharisSIL-Italic.woff2') format('woff2'),
15+
url('/yindian/fonts/CharisSIL/CharisSIL-Italic.ttf') format('truetype');
1616
font-weight: normal;
1717
font-style: italic;
1818
}
1919

2020
@font-face {
2121
font-family: 'Charis SIL';
2222
src: local('Charis SIL Bold'),
23-
url('/fonts/CharisSIL/CharisSIL-Bold.woff2') format('woff2'),
24-
url('/fonts/CharisSIL/CharisSIL-Bold.ttf') format('truetype');
23+
url('/yindian/fonts/CharisSIL/CharisSIL-Bold.woff2') format('woff2'),
24+
url('/yindian/fonts/CharisSIL/CharisSIL-Bold.ttf') format('truetype');
2525
font-weight: bold;
2626
font-style: normal;
2727
}
2828

2929
@font-face {
3030
font-family: 'Charis SIL';
3131
src: local('Charis SIL Bold Italic'),
32-
url('/fonts/CharisSIL/CharisSIL-BoldItalic.woff2') format('woff2'),
33-
url('/fonts/CharisSIL/CharisSIL-BoldItalic.ttf') format('truetype');
32+
url('/yindian/fonts/CharisSIL/CharisSIL-BoldItalic.woff2') format('woff2'),
33+
url('/yindian/fonts/CharisSIL/CharisSIL-BoldItalic.ttf') format('truetype');
3434
font-weight: bold;
3535
font-style: italic;
3636
}
3737

3838
/* SBB Web Font Faces */
3939
@font-face {
4040
font-family: 'SBB';
41-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Thin.woff2') format('woff2');
41+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Thin.woff2') format('woff2');
4242
font-weight: 100;
4343
font-style: normal;
4444
}
4545

4646
@font-face {
4747
font-family: 'SBB';
48-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Light.woff2') format('woff2');
48+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Light.woff2') format('woff2');
4949
font-weight: 300;
5050
font-style: normal;
5151
}
5252

5353
@font-face {
5454
font-family: 'SBB';
55-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Roman.woff2') format('woff2');
55+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Roman.woff2') format('woff2');
5656
font-weight: 400;
5757
font-style: normal;
5858
}
5959

6060
@font-face {
6161
font-family: 'SBB';
62-
src: url('/fonts/SBBWeb_v1_9/SBBWeb-Bold.woff2') format('woff2');
62+
src: url('/yindian/fonts/SBBWeb_v1_9/SBBWeb-Bold.woff2') format('woff2');
6363
font-weight: 700;
6464
font-style: normal;
6565
}

0 commit comments

Comments
 (0)