How to Deploy a Theme From GitHub to Your Ghost Blog (With Secrets)

Learn how to automate Ghost theme deployment using GitHub Actions, secrets, and custom workflows — no more manual zipping or uploads.

How to Deploy a Theme From GitHub to Your Ghost Blog (With Secrets)
Photo by Florian Olivo / Unsplash

Tired of zipping theme files by hand every time you tweak your Ghost site?
Yeah — I was too.

In today’s post, I’ll show you how I automated the entire process using GitHub Actions — from customizing Ghost’s default theme (Source) to deploying updates instantly across multiple sites. No more manual packaging. No more uploads. Just push and go.

This isn’t just about Ghost, either. Whether you're building themes or managing plugins, learning GitHub Actions is a game-changer that saves time and scales with you.

What you’re about to read is an updated and streamlined version of my original 2022 guide for the Casper theme — now cleaner, faster, and focused on Source.

You’ll learn:

  • How to fork and customize Source
  • How to define secrets in GitHub Actions
  • How to auto-deploy your theme to all your sites

Ready to stop babysitting zip files and start shipping like a pro?

Let’s dive in.

1. Fork the Source Theme (or Your Theme of Choice)

Start by grabbing Ghost’s official Source theme.
Fork it to your GitHub profile, then clone it locally so you can start customizing it.

💡
Want to use a different theme? No problem. This workflow works with any Ghost-compatible theme, as long as it’s version-controlled and follows Ghost's theme structure.

2. Set Up a Custom Integration in Ghost

In your Ghost Admin:

  • Go to Settings → Integrations
  • Scroll down and click Add custom integration
  • Name it something like GitHub Actions or GitHub Deployment

You’ll get two things:

  • Admin API URL
  • Admin API Key

📌 Copy both — we’ll need them in the next step.

3. Add Secrets to Your GitHub Repo

Head over to your GitHub repository:

  • Click Settings → Secrets and variables → Actions
  • Hit New repository secret

Add two secrets:

  • GHOST_ADMIN_API_URL
  • GHOST_ADMIN_API_KEY

(Use whatever names you like — just remember to reference them correctly in your workflow.)

Here’s a quick Loom explaining this step if you’re more of a visual learner:

4. Add Any Other Secrets You Need

For example: I use Hyvor Talk as a comment plugin. Since my theme repo is public, I don’t want my real site ID hardcoded.

So I:

  1. Store the real ID as a GitHub Secret
  2. Add a step in my GitHub Action to replace a placeholder with the real value before deployment
This technique works for any sensitive config — comment systems, analytics tags, API keys, etc.

5. Understand What the Workflow Will Do

Once written, your GitHub Action will:

  • Run on every push to the main branch
  • Replace any placeholder secrets in your theme
  • Deploy the updated theme to your Ghost site via Ghost’s official action

Note: If you forked Source, make sure to provide a theme-name in the action config. Otherwise, Ghost won’t know to register it as a separate theme.

6. (Optional) Deploy Only on Tags

Want more control? Trigger deployments only when you push a Git tag.

This gives you:

  • Freedom to make multiple changes
  • Local testing before deployment
  • Clear versioning like v1.0.2, v2.1.0, etc.

That’s the setup I personally use now.

7. (Bonus) Deploy to Multiple Ghost Sites

I run multiple Ghost blogs — and this setup makes it simple.

Each site gets its own:

  • YAML workflow file
  • Separate secrets (different Admin URLs and Keys)
  • Optional comment system config

You can use one repo to serve many different frontends. Just swap out what each workflow injects.

8. Watch It Work

If everything’s set up correctly:

  1. Push your changes (or tag a release)
  2. GitHub Actions will run the workflow
  3. A new theme version will show up in your Ghost Admin under Design

⚠️ Before activating it:

  • Download and inspect the theme to confirm all secrets were properly injected
  • Check that your custom comment system or config replacements are in place

Want My Full Workflow & Starter Repo?

Everything above shows you how to build this setup from scratch.

But if you want to skip the manual YAML writing, grab my starter repo, and see how I deploy across multiple sites — I’ve bundled everything together below:

  • 📄 A copy-paste GitHub Actions workflow (clean + commented)
  • 🔁 Bonus: multi-site deployment template
  • 💬 Secret-injection example (e.g., Hyvor Talk ID)
  • 📦 Direct link to my public Ghost Source fork, ready to clone
Already a subscriber? You’ll see it below.
Not yet? Sign up free to unlock it — no spam, just useful dev workflows.