1. gh-pages 설치
yarn add -D gh-pages npm i --save-dev gh-pages
2. package.json에서 스크립트 추가
"gh_build": "next build && next export", "gh_deploy": "touch out/.nojekyll && gh-pages -d out --dotfiles"
3. next.config.js 설정
const nextConfig = { basePath: "/${REPO_NAME}", // {ACCOUNT_NAME}.github.io/${REPO_NAME} ... images: { loader: 'akamai', path: '' } };
4. 빌드 및 배포
npm run gh_build npm run gh_deploy
5. 저장소 pages 설정
- Github 저장소의 Settings > Pages에서 gh_pages 브랜치로 Github Pages 설정을 한다

- 사이트가 정상적으로 배포되었음을 확인한다
