./dev-ops
Jekyll/Chirpy로 GitHub Pages 만들기
1) 저장소 생성
- 방법 A: Chirpy Release 소스 다운로드
- 방법 B: Chirpy 저장소 Fork
- Repository Name:
<계정명>.github.io, Public, README 자동생성 체크 해제
A) 다운로드한 경우
echo "Gemfile.lock" >> .gitignore
git init
git remote add origin https://github.com/<계정명>/<계정명>.github.io.git
git branch -M main
git add .
git commit -m "Initial commit"
B) Fork한 경우
git clone https://github.com/<계정명>/<계정명>.github.io.git
2) Chirpy 초기화
sh tools/init.sh
3) (선택) 로컬 실행 환경
Windows: Ruby Installer 설치 → Start Command Prompt with Ruby →
gem install jekyll minima bundler jekyll-feed tzinfo-data
macOS:
brew install ruby
gem install --user-install bundler jekyll
ruby -v # 버전 확인 후 아래 X.X에 반영
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.zshrc
공통:
bundle
jekyll serve # 또는
bundle exec jekyll s # 또는 Docker
docker run -it --rm --volume="$PWD:/srv/jekyll" -p 4000:4000 jekyll/jekyll jekyll serve
4) GitHub Actions 권한
저장소 Settings > Actions > General > Workflow permissions를 Read and write permissions로 변경
5) _config.yml 필수 수정
lang: ko-KRtimezone: Asia/Seoulurl: https://<계정명>.github.io
6) 배포
git add -A
git commit -m "Update configure"
git push
- push 시 GitHub Actions가 자동 build/deploy (3~5분),
gh-pages브랜치 자동 생성 - 저장소 Settings > Pages > Source를
main에서gh-pages로 변경