nugawiki

./dev-ops

Jekyll/Chirpy로 GitHub Pages 만들기

업데이트 2026-07-20 2분 소요 /DEV-OPS #GIT/SVN

1) 저장소 생성

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

http://localhost:4000 확인

4) GitHub Actions 권한

저장소 Settings > Actions > General > Workflow permissions를 Read and write permissions로 변경

5) _config.yml 필수 수정

  • lang: ko-KR
  • timezone: Asia/Seoul
  • url: 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로 변경

참조