Forgejo Action to deploy Ghost theme to site via API
Find a file
2026-03-10 19:33:04 -07:00
.forgejo/workflows ci: auto update readme 2026-03-10 19:33:04 -07:00
action.yml Initial composite action for Ghost theme deployment 2026-03-05 15:01:15 -08:00
README.md Initial composite action for Ghost theme deployment 2026-03-05 15:01:15 -08:00

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

  1. Runs your build command (default: npm ci && npx gulp zip)
  2. Reads the theme name from package.json (or uses your override)
  3. Creates a short-lived JWT from the Admin API key
  4. Uploads dist/<theme-name>.zip to the Ghost Admin API
  5. Activates the uploaded theme