Posts

Showing posts with the label Elle Maculada

automating your jekyll deployment after migrating from wordpress

Why automate your Jekyll workflow after leaving WordPress?

WordPress has a built-in dashboard, automatic updates, and one-click publishing. When you move to Jekyll, you trade that convenience for speed, control, and security. But to avoid extra manual work, you must reintroduce automation—especially for building, testing, and deploying your static site.

This article explains how to automate your Jekyll site deployment after migrating from WordPress, using GitHub Actions and GitHub Pages for a modern, developer-friendly workflow.

What does a typical Jekyll deployment workflow look like?

After moving from WordPress to Jekyll, your deployment workflow becomes file-based. You write Markdown content, commit changes, and build static HTML output. While it's possible to run jekyll build manually, this quickly becomes tedious, especially on multi-author sites.

Instead, you can set up a continuous deployment pipeline like this:

  1. Push changes to a GitHub repository
  2. Trigger a GitHub Actions workflow to build the site
  3. Deploy the output to GitHub Pages or another host (e.g., Netlify, Cloudflare Pages)

How do you configure GitHub Actions for Jekyll?

Create a workflow file in your repository: .github/workflows/jekyll.yml

name: Build and Deploy Jekyll Site

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout source
      uses: actions/checkout@v4

    - name: Setup Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: '3.2'

    - name: Install dependencies
      run: |
        gem install bundler
        bundle install

    - name: Build Jekyll site
      run: bundle exec jekyll build

    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: ./_site

This configuration installs Ruby, builds your Jekyll site, and publishes the HTML to the gh-pages branch automatically after every commit to main.

How is this different from WordPress publishing?

In WordPress, changes are published instantly through a GUI. With Jekyll + GitHub Actions, the "publish" step is replaced by a Git push. While this may feel technical at first, it provides version control, collaborative editing, and rollback capabilities that WordPress doesn't offer natively.

More importantly, deployment is deterministic: what works in your development environment will work in production, eliminating plugin conflicts or corrupted database issues.

Can this workflow support content teams?

Absolutely. Here’s how:

  • Editorial Markdown: Writers can use GitHub Desktop or Netlify CMS to edit Markdown files.
  • Pull Requests: Editors review changes via PRs before merging to main.
  • Preview Builds: You can set up deploy previews on every PR using Netlify or Cloudflare Pages.

This creates a professional editorial pipeline, even for non-technical users, with a lower risk of accidental damage.

What about scheduled posts or dynamic features?

Jekyll doesn’t support native scheduled publishing like WordPress. But you can simulate it:

  • Post-dated Content: Jekyll can be configured to exclude future-dated posts with future: false in _config.yml.
  • Scheduled GitHub Actions: Run a cron job to rebuild the site daily, picking up any now-valid content:
on:
  schedule:
    - cron: '0 * * * *'

For dynamic components (e.g., search, comments), offload functionality to third-party services like Algolia, Disqus, or CloudCannon.

What if you want to host somewhere other than GitHub Pages?

Jekyll sites can be deployed to many hosts:

  • Netlify: Supports Jekyll builds and previews with custom domain management
  • Cloudflare Pages: Offers DDoS protection and edge CDN for free
  • Vercel or Render: Use custom build commands and serve your static output

You can modify the GitHub Actions workflow to deploy to these platforms via CLI or APIs.

How do you manage secrets and environment variables?

Use GitHub Secrets to store API keys or tokens needed for deployment (e.g., Algolia credentials, Netlify tokens). Reference them in your workflow like this:

env:
  ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}

How do you handle build errors or failed deployments?

GitHub Actions provides logs for every build. You can set up email or Slack notifications for failures. Additionally, consider using status: failing badges in your README to monitor build health visually.

What are the long-term benefits of this automation?

  • Scalability: Supports multiple authors, branches, and preview deployments
  • Reliability: No reliance on a PHP/SQL stack prone to failure
  • Transparency: Every change is tracked in Git history
  • Speed: Continuous deployment ensures your site is always up to date

Conclusion

Once you've moved from WordPress to Jekyll, automating your workflow is the next logical step. GitHub Actions offers a powerful, flexible, and free solution for building and deploying your static site. When configured correctly, your new Jekyll blog can rival the publishing speed and convenience of WordPress—without its baggage.

Whether you're a solo creator or managing a distributed content team, automation is the key to making your Jekyll site production-ready and scalable.