Forgejo Action to deploy Ghost theme to site via API
| .forgejo/workflows | ||
| action.yml | ||
| README.md | ||
Ghost Theme Deploy Action
A reusable Forgejo composite action that builds and deploys a Ghost theme via the Admin API.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
ghost-url |
Yes | Ghost site URL (e.g., https://www.example.com) |
|
ghost-admin-api-key |
Yes | Ghost Admin API key in id:secret format |
|
build-command |
No | npm ci && npx gulp zip |
Command to install deps and build the theme zip |
theme-name |
No | (from package.json) | Override the theme name used for the zip filename and activation |
Requirements
The runner environment must have node and curl available (e.g., node:22-slim container with curl installed).
The build command must produce a zip file at dist/<theme-name>.zip.
Usage
Basic (gulp-based theme)
# .forgejo/workflows/deploy.yml
name: Deploy theme to Ghost
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: docker
container:
image: node:22-slim
steps:
- name: Setup
run: apt-get update -qq && apt-get install -y -qq git curl > /dev/null
- name: Checkout
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git clone "https://ci:${{ github.token }}@git.brads.house/${{ github.repository }}.git" "$GITHUB_WORKSPACE"
- name: Deploy to Ghost
uses: actions/ghost-deploy@v1
with:
ghost-url: https://www.example.com
ghost-admin-api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
Custom build command
- name: Deploy to Ghost
uses: actions/ghost-deploy@v1
with:
ghost-url: https://other-site.com
ghost-admin-api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
build-command: 'yarn install && yarn zip'
Override theme name
- name: Deploy to Ghost
uses: actions/ghost-deploy@v1
with:
ghost-url: https://www.example.com
ghost-admin-api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
theme-name: my-custom-name
How it works
- Runs your build command (default:
npm ci && npx gulp zip) - Reads the theme name from
package.json(or uses your override) - Creates a short-lived JWT from the Admin API key
- Uploads
dist/<theme-name>.zipto the Ghost Admin API - Activates the uploaded theme