File tree Expand file tree Collapse file tree 4 files changed +116
-3
lines changed
Expand file tree Collapse file tree 4 files changed +116
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ # GitHub Pages 권한 설정
10+ permissions :
11+ contents : read
12+ pages : write
13+ id-token : write
14+
15+ # 동시 배포 방지
16+ concurrency :
17+ group : " pages"
18+ cancel-in-progress : false
19+
20+ jobs :
21+ # 빌드 잡
22+ build :
23+ runs-on : ubuntu-latest
24+
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v4
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : ' 20'
33+
34+ - name : Setup pnpm
35+ uses : pnpm/action-setup@v4
36+ with :
37+ run_install : false
38+
39+ - name : Get pnpm store directory
40+ shell : bash
41+ run : |
42+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
43+
44+ - name : Setup pnpm cache
45+ uses : actions/cache@v4
46+ with :
47+ path : ${{ env.STORE_PATH }}
48+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+ restore-keys : |
50+ ${{ runner.os }}-pnpm-store-
51+
52+ - name : Install dependencies
53+ run : pnpm install --frozen-lockfile
54+
55+ - name : Lint
56+ run : pnpm lint
57+
58+ - name : Build
59+ run : pnpm build
60+ env :
61+ # GitHub Pages 하위 경로를 위한 base 설정
62+ VITE_BASE_URL : /${{ github.event.repository.name }}/
63+
64+ - name : Setup Pages
65+ uses : actions/configure-pages@v5
66+
67+ - name : Upload artifact
68+ uses : actions/upload-pages-artifact@v3
69+ with :
70+ path : ./dist
71+
72+ # 배포 잡 (main 브랜치에서만)
73+ deploy :
74+ if : github.ref == 'refs/heads/main'
75+ environment :
76+ name : github-pages
77+ url : ${{ steps.deployment.outputs.page_url }}
78+ runs-on : ubuntu-latest
79+ needs : build
80+
81+ steps :
82+ - name : Deploy to GitHub Pages
83+ id : deployment
84+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 33 "private" : true ,
44 "version" : " 0.0.0" ,
55 "type" : " module" ,
6+ "packageManager" : " pnpm@9.0.0" ,
67 "scripts" : {
78 "dev" : " vite" ,
89 "build" : " tsc -b && vite build" ,
1415 "dependencies" : {
1516 "@tanstack/react-query" : " ^5.84.2" ,
1617 "react" : " ^19.1.1" ,
17- "react-dom" : " ^19.1.1"
18+ "react-dom" : " ^19.1.1" ,
19+ "zustand" : " ^5.0.2"
1820 },
1921 "devDependencies" : {
2022 "@eslint/js" : " ^9.33.0" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import path from "node:path"
55// https://vite.dev/config/
66export default defineConfig ( {
77 plugins : [ react ( ) ] ,
8+ base : process . env . VITE_BASE_URL || "/" ,
89 resolve : {
910 alias : {
1011 "@" : path . resolve ( __dirname , "src" ) ,
You can’t perform that action at this time.
0 commit comments