gh-pages로 배포하기

slppills·2024년 7월 2일
0

TIL

목록 보기
21/69

1. gh-pages 설치하기

yarn add gh-pages --save-dev

2. package.json 수정하기

"homepage": "https://깃허브아이디.github.io/배포할폴더이름",  //상단에 추가

"predeploy": "yarn build",		//script에 추가
"deploy": "gh-pages -d build"	//script에 추가

3. 배포하기

yarn build

yarn deploy

4. 배포할 깃허브 레포지토리 -> Settings -> Pages -> Branch를 gh-pages로 바꾸고 Save버튼 클릭

4번까지 완료하면 조금뒤에 위 사진과 같이 배포된 주소가 나온다.

2개의 댓글

comment-user-thumbnail
2024년 7월 3일

👍

답글 달기
comment-user-thumbnail
2024년 7월 4일

왜 내댓글 지우냐

답글 달기