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
- Validate basic Markdown specifications.
- Check the availability of internal links.
- 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 build2. Dead Link Checking (Optional but Recommended)
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
bundler: command not found: jekyll: Gem dependencies aren’t fully installed. Runbundle installfirst.Front Mattersyntax error: Check if---is paired and if indentation is consistent.- False positive dead links: Verify locally with
curl -Ifirst, 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.
If this article helped you, please share it with others!
Some information may be outdated





