🚀Auto-Deploy a Ghost Theme (Self-Hosted)
Ghost makes automated theme deployment surprisingly smooth once you hook it into GitHub Actions.
The most reliable and widely used method is:
GitHub Actions → Ghost Admin API → Auto‑deploy theme on every push
This works whether your Ghost instance is running via Docker, bare metal, or a managed VPS.
🧩 Step 1 — Create a Custom Integration in Ghost
- Log into your Ghost Admin
- Go to Settings → Integrations → Add custom integration
- Name it something like GitHub Actions
- Copy:
- API URL
- Admin API Key
You’ll need these for GitHub.
🔐 Step 2 — Add Secrets to Your GitHub Repo
In your theme repository:
- Go to Settings → Secrets and variables → Actions
- Add two secrets:
| Secret Name | Value |
|---|---|
GHOST_ADMIN_API_URL |
Your Ghost Admin API URL |
GHOST_ADMIN_API_KEY |
Your Admin API key |
These are required by the official deployment action.
⚙️ Step 3 — Add the GitHub Actions Workflow
Create a file:
.github/workflows/deploy-theme.yml
Paste this (from the official Ghost deployment action):
name: Deploy Ghost Theme
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy Ghost Theme
uses: TryGhost/action-deploy-theme@v1
with:
api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
This workflow:
- Zips your theme
- Uploads it to Ghost
- Activates it automatically
- Runs every time you push to
main
🧪 Step 4 — Push a Commit to Test
Just push any change:
git add .
git commit -m "Test auto-deploy"
git push
GitHub Actions will run → upload → activate your theme.
You can watch the logs in Actions.
🎉 That’s it — fully automated theme deployment!
This setup is recommended directly by Ghost’s official GitHub integration docs and the Ghost Theme Deploy Action on GitHub Marketplace.