Skip to content

Commit f0bb37a

Browse files
committed
배포자동화 Git Action 추가
1 parent 9d3acae commit f0bb37a

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/deloy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: GitHub Pages Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main # main 브랜치에 push할 때 자동 배포
7+
8+
jobs:
9+
build:
10+
name: Build and Deploy to GitHub Pages
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 18 # 프로젝트에 맞는 Node.js 버전
21+
22+
- name: Install Dependencies
23+
run: npm install
24+
25+
- name: Build Project
26+
run: npm run build # 프로젝트에 맞는 빌드 명령어로 수정
27+
28+
- name: Deploy to GitHub Pages
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: ./build # 빌드 결과물이 저장되는 디렉토리 (React는 보통 build)

0 commit comments

Comments
 (0)