mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4
207 words
1 minute
GitHub Actions in Practice: Building an Automated Quality Check Pipeline for a Jekyll Blog
2024-11-18

Many personal blogs only possess “the ability to publish” but lack “automated pre-publish acceptance testing.” As the number of articles grows, dead links, Front Matter errors, and build failures will frequently occur.

This tutorial gives you a lightweight CI: do three things automatically on every Push/PR.

Goal#

  1. Validate basic Markdown specifications.
  2. Check the availability of internal links.
  3. Execute a Jekyll build to ensure it’s publishable.

1. Create a New Workflow#

Create .github/workflows/blog-quality.yml:

name: Blog Quality
on:
push:
branches: ["master", "main"]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install markdownlint
run: npm i -g markdownlint-cli
- name: Lint markdown
run: markdownlint "**/*.md" --ignore node_modules
- name: Build Jekyll
run: bundle exec jekyll build

You can add lychee:

- name: Link check
uses: lycheeverse/lychee-action@v2
with:
args: --verbose --no-progress "./**/*.md" "./_site/**/*.html"

If you have many external links, it is recommended to whitelist domains that occasionally timeout to avoid false positives.

3. Branch Protection#

Enable Branch Protection in the repository settings:

  • Require PRs to pass Blog Quality.
  • Forbid direct pushes to the main branch.

This step significantly reduces the probability of “accidentally pushing broken content to production.”

Common Errors and Troubleshooting#

  1. bundler: command not found: jekyll: Gem dependencies aren’t fully installed. Run bundle install first.
  2. Front Matter syntax error: Check if --- is paired and if indentation is consistent.
  3. False positive dead links: Verify locally with curl -I first, then add them to the ignore list.

Summary#

The key to a high-quality blog isn’t writing fast, but ensuring “every release is stable.” Once you set up CI, you can focus your energy on content instead of production troubleshooting.

Share

If this article helped you, please share it with others!

GitHub Actions in Practice: Building an Automated Quality Check Pipeline for a Jekyll Blog
https://blog.levifree.com/posts/github-actions-blog-ci-cd/
Author
LeviFREE
Published at
2024-11-18
License
CC BY-NC-SA 4.0

Some information may be outdated

Table of Contents