본문 바로가기
OpenSource

gh-pages 로 배포하기

by egas 2021. 7. 17.

https://pages.github.com/

 

GitHub Pages

Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.

pages.github.com

 

gh-pages를 사용해보자.

 

1. gh-pages 패키지 설치

yarn add -D gh-pages

 

2. package.json 에 다음 추가.

"homepage" : "https://<user name>.github.io/<project name>"

 

3. package.json "scripts"에 다음 추가

"predeploy" : "npm run build",
"deploy" : "gh-pages -d build"

 

최종 package.json 예시

{
  "name": "example",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    ...
  },
  "scripts": {
    ...
    "predeploy": "yarn run build",
    "deploy": "gh-pages -d build"
  },
  "devDependencies": {
    "gh-pages": "^3.2.3"
  },
  "homepage": "https://hochan222.github.io/holee-contextmenu"
}

 

4. deploy 하기

yarn run deploy

 

5. 배포된 github pages 들어가서 확인하기

https://<user name>.github.io/<project name>/
728x90

'OpenSource' 카테고리의 다른 글

ripgrep 소개  (0) 2021.07.30
gource 소개  (0) 2021.07.28
Github changelogs  (0) 2021.07.18
Github multiple authors  (0) 2021.07.17
gpg를 설정 해보자! (github verified)  (0) 2021.05.13

댓글