Skip to content

Commit dfff3f2

Browse files
committed
Prepare github frontend deployment
1 parent 35d76c3 commit dfff3f2

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./frontend
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "22"
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v4
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./frontend/dist
37+
publish_branch: gh-pages
38+
cname: ""

frontend/vite.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
3-
import { resolve } from 'path'
3+
// import { resolve } from 'path' // 제거: node path 모듈은 브라우저 빌드에 불필요
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7+
base: '/chat/', // GitHub Pages용 base 경로
78
plugins: [react()],
89
resolve: {
910
alias: {
10-
"@": resolve(__dirname, "./src"),
11+
"@": '/src',
1112
},
1213
},
1314
server: {

0 commit comments

Comments
 (0)