Starting a GitHub Pages blog with the Jekyll Chirpy starter
How to create a GitHub Pages technical blog from the Jekyll Chirpy starter template, automate deployments with GitHub Actions, and preview posts locally.
Setting up a self-owned engineering blog takes more upfront work than signing up for a hosted writing platform, but you keep full control over markup, layout, and Git history. This post walks through bootstrapping a GitHub Pages blog from the official
chirpy-startertemplate, wiring up GitHub Actions deployment, and running a live-reloading local preview.
Verified with Jekyll 4.x,
jekyll-theme-chirpy(gem-based starter), Ruby 3.3+, and GitHub Actions Pages deployment.
Why GitHub Pages instead of a hosted platform
When I decided to document what I was learning and the production bugs I ran into, I compared four common options before committing to a stack. Each comes with clear trade-offs around ownership, styling control, and maintenance cost.
| Platform | Strengths | Trade-offs | Hosting cost |
|---|---|---|---|
| GitHub Pages + Jekyll | Git version history for every post, full HTML/SCSS/plugin control, Markdown-native workflow | Initial Ruby/Bundler setup, plugin dependency management | Free |
| Velog | Fast Markdown editor, built-in developer discovery feed in Korea | No custom domain support, fixed layout and styling | Free |
| Tistory | Familiar web admin UI, straightforward ad placement | Platform policy changes outside your control, no native Git workflow | Free |
| WordPress | Massive plugin and theme ecosystem, full CMS features | Ongoing server and database hosting cost, recurring security patches | Paid |
Four requirements narrowed the choice down quickly:
- Git-backed history: I wanted every draft, edit, and refactor tracked as normal
git commithistory alongside my code repositories. - Unrestricted customization: I needed direct access to layouts, SCSS, metadata tags, and build hooks without waiting on platform feature requests.
- IDE-first writing: Writing in VS Code with local preview beats wrestling with a browser-based WYSIWYG editor when a post contains heavy code blocks.
- Zero baseline hosting cost: Static HTML served from GitHub Pages handles traffic spikes without a monthly VPS bill.
When not to use Jekyll on GitHub Pages
GitHub Pages with Jekyll is a poor fit if you want non-technical collaborators to publish from a web dashboard, if you need dynamic server-side endpoints (authentication, forms with database storage), or if you already maintain a React/TypeScript frontend and prefer writing MDX components in Astro or Next.js. In those cases, a headless CMS or a JS-based static site generator will save you friction.
Why I picked the Chirpy theme
The Jekyll Themes ecosystem has hundreds of open-source options, but most minimalist themes leave you building basic technical-blog features from scratch. I chose Chirpy (jekyll-theme-chirpy) because it ships the essentials out of the box:
- Responsive layout: Desktop, tablet, and mobile viewports work cleanly without custom media queries on day one.
- Built-in light and dark modes: Respects the reader’s OS preference and exposes a manual toggle in the sidebar.
- Technical writing primitives: Syntax highlighting via Rouge, Mermaid diagrams, MathJax equations, and a sticky right-hand table of contents (TOC) are wired in by default.
- Gem-based starter workflow: Instead of forking the entire theme repository and fighting merge conflicts on every upgrade,
chirpy-starterpulls the theme as a Ruby gem and deploys through an official GitHub Actions workflow.
Step 1: Create the repository from chirpy-starter
Under the hood, chirpy-starter separates your content and overrides from the theme’s core templates. Your repository only holds _config.yml, _posts/, custom overrides, and a Gemfile that pins jekyll-theme-chirpy. When GitHub Actions runs bundle exec jekyll build, Bundler fetches the theme gem and merges your local files on top of it.
flowchart TD
A["chirpy-starter template"] -->|"Use this template"| B["username.github.io repo"]
B -->|"git push"| C["GitHub Actions CI"]
C -->|"pages-deploy.yml"| D["GitHub Pages hosting"]
Follow these steps to create your repository:
- Open the official chirpy-starter repository.
- Click
Use this templatein the upper right and selectCreate a new repository. - Name the repository using the GitHub user-site convention:
- Pattern:
<your-github-username>.github.io - Example:
cmsong111.github.io
- Pattern:
Naming the repository
<username>.github.iopublishes the site at the root URLhttps://<username>.github.io/with no subdirectory prefix. Any other repository name deploys under/<repo-name>/, which requires settingbaseurlin_config.yml.
Step 2: Switch GitHub Pages to GitHub Actions
Older Jekyll tutorials tell you to push compiled files to a gh-pages branch or rely on GitHub’s legacy branch builder. That legacy builder restricts which Jekyll plugins can run. Switching the deployment source to GitHub Actions removes that restriction and lets Chirpy’s bundled workflow build and test the site in a clean Ubuntu runner.
Change the deployment source
- Open your new repository’s
Settingstab. - Select
Pagesin the left sidebar. - Under
Build and deployment, changeSourcefromDeploy from a branchtoGitHub Actions.
Figure 1. GitHub Pages settings panel where the build source is switched to GitHub Actions.
What pages-deploy.yml actually runs
The starter repository already includes .github/workflows/pages-deploy.yml. On every push to main, it executes five stages:
- Checkout with full Git history (
fetch-depth: 0): Chirpy’slast_modified_athook reads commit timestamps from Git, so a shallow clone would break modification dates. - Ruby setup and Bundler cache: Installs Ruby and caches gem downloads between runs.
- Production Jekyll build: Runs
bundle exec jekyll build -d _siteto generate static HTML, CSS, and feeds. - Static HTML verification (
htmlproofer): Scans_sitefor broken internal links, missing images, and malformed HTML before anything goes live. - Pages artifact upload and deploy: Publishes the verified
_siteartifact to GitHub Pages.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Key steps from .github/workflows/pages-deploy.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Build Site
run: bundle exec jekyll build -d _site
- name: Test site
run: |
bundle exec htmlproofer _site \
--disable-external \
--ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
Once the workflow finishes with a green checkmark in the Actions tab, your live URL appears under the deploy job.
Figure 2. Successful build, htmlproofer check, and deployment in the GitHub Actions tab.
Step 3: Set up a local live-reload preview
Pushing to main just to check a typo or image alignment slows down writing. Cloning the repository locally and running Jekyll’s built-in server gives you instant feedback before you commit.
Clone and install gems
1
2
3
git clone https://github.com/<username>/<username>.github.io.git blog
cd blog
bundle install
Start the development server
1
bundle exec jekyll serve --livereload
Open http://localhost:4000 in your browser. Saving a Markdown post triggers an incremental rebuild and refreshes the tab automatically.
Figure 3. Default Chirpy home view running locally at localhost:4000.
Common setup pitfalls and checklist
A few small details tend to trip up first-time Chirpy deployments:
Do not fork
jekyll-theme-chirpydirectly unless you plan to maintain the theme itself. Forking mixes theme internals with your posts and makes upgrading to newer Chirpy versions painful. Stick tochirpy-starterand override individual files only when needed.
- Keep
fetch-depth: 0in the workflow: Removing it breaks Git-basedlast_modified_attimestamps across posts. - Check
Gemfile.lockplatforms: If you runbundle installon macOS (Apple Silicon) and push to Ubuntu runners on GitHub Actions, runbundle lock --add-platform x86_64-linuxif Bundler complains about missing Linux gem specs. - Fix
htmlproofererrors locally: Broken relative links or missingaltattributes fail the CI job intentionally, so runbundle exec jekyll buildbefore pushing major edits.
Post-setup checklist
- Repository created from
chirpy-starter(not forked from the core theme) - GitHub Pages
Sourceswitched to GitHub Actions - First
pages-deploy.ymlrun green with live URL accessible - Local preview working via
bundle exec jekyll serve --livereload
With the skeleton repository and automated deployment pipeline in place, the next step is configuring branding, locale, comments, and analytics in _config.yml.