Blog › Jekyll

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.

Starting a GitHub Pages blog with the Jekyll Chirpy starter

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-starter template, 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.

PlatformStrengthsTrade-offsHosting cost
GitHub Pages + JekyllGit version history for every post, full HTML/SCSS/plugin control, Markdown-native workflowInitial Ruby/Bundler setup, plugin dependency managementFree
VelogFast Markdown editor, built-in developer discovery feed in KoreaNo custom domain support, fixed layout and stylingFree
TistoryFamiliar web admin UI, straightforward ad placementPlatform policy changes outside your control, no native Git workflowFree
WordPressMassive plugin and theme ecosystem, full CMS featuresOngoing server and database hosting cost, recurring security patchesPaid

Four requirements narrowed the choice down quickly:

  1. Git-backed history: I wanted every draft, edit, and refactor tracked as normal git commit history alongside my code repositories.
  2. Unrestricted customization: I needed direct access to layouts, SCSS, metadata tags, and build hooks without waiting on platform feature requests.
  3. 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.
  4. 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-starter pulls 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:

  1. Open the official chirpy-starter repository.
  2. Click Use this template in the upper right and select Create a new repository.
  3. Name the repository using the GitHub user-site convention:
    • Pattern: <your-github-username>.github.io
    • Example: cmsong111.github.io

Naming the repository <username>.github.io publishes the site at the root URL https://<username>.github.io/ with no subdirectory prefix. Any other repository name deploys under /<repo-name>/, which requires setting baseurl in _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

  1. Open your new repository’s Settings tab.
  2. Select Pages in the left sidebar.
  3. Under Build and deployment, change Source from Deploy from a branch to GitHub Actions.

GitHub Pages deployment source set to GitHub 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:

  1. Checkout with full Git history (fetch-depth: 0): Chirpy’s last_modified_at hook reads commit timestamps from Git, so a shallow clone would break modification dates.
  2. Ruby setup and Bundler cache: Installs Ruby and caches gem downloads between runs.
  3. Production Jekyll build: Runs bundle exec jekyll build -d _site to generate static HTML, CSS, and feeds.
  4. Static HTML verification (htmlproofer): Scans _site for broken internal links, missing images, and malformed HTML before anything goes live.
  5. Pages artifact upload and deploy: Publishes the verified _site artifact 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.

GitHub Actions deployment workflow run completing successfully 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.

Jekyll Chirpy home page rendered on the local development server 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-chirpy directly unless you plan to maintain the theme itself. Forking mixes theme internals with your posts and makes upgrading to newer Chirpy versions painful. Stick to chirpy-starter and override individual files only when needed.

  • Keep fetch-depth: 0 in the workflow: Removing it breaks Git-based last_modified_at timestamps across posts.
  • Check Gemfile.lock platforms: If you run bundle install on macOS (Apple Silicon) and push to Ubuntu runners on GitHub Actions, run bundle lock --add-platform x86_64-linux if Bundler complains about missing Linux gem specs.
  • Fix htmlproofer errors locally: Broken relative links or missing alt attributes fail the CI job intentionally, so run bundle exec jekyll build before pushing major edits.

Post-setup checklist

  • Repository created from chirpy-starter (not forked from the core theme)
  • GitHub Pages Source switched to GitHub Actions
  • First pages-deploy.yml run 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.

This post is licensed under CC BY 4.0 by the author.