This reusable spinup-initial-deploy workflow can be called from a central .github repository or from other repositories to build and deploy WordPress themes to SpinupWP servers.
- Auto-detects theme name from
web/app/themes/directory (or accepts manual override) - Configurable PHP and Node.js versions
- Centralized SATISPRESS_TOKEN (optional - falls back to workflow repo token)
- Full build pipeline with Composer dependencies and Yarn asset compilation
- Rsync deployment to remote server
- Cache clearing via SpinupWP CLI
Add this to the calling repository's .github/workflows directory (example: .github/workflows/deploy-staging.yml):
name: Initial Deploy to Staging
on:
workflow_dispatch:
jobs:
deploy:
uses: Studio-Lemon/workflows/.github/workflows/spinup-deploy.yml@main
secrets: inherit
with:
initial_deploy: truename: Deploy to Staging
on:
push:
branches: [staging]
jobs:
deploy:
uses: Studio-Lemon/workflows/.github/workflows/spinup-deploy.yml@main
secrets: inheritname: Deploy to Staging
on:
push:
branches: [staging]
workflow_dispatch:
jobs:
deploy:
uses: Studio-Lemon/workflows/.github/workflows/spinup-deploy.yml@main
with:
theme: 'my-custom-theme' # Optional - will auto-detect if not provided
php_version: '8.2' # Optional - defaults to '8.3'
node_version: '18' # Optional - defaults to 'lts/*'
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SATISPRESS_TOKEN: ${{ secrets.CUSTOM_SATISPRESS_TOKEN }} # Optional overrideYou can also call the workflow locally (from the same repository) by using a uses reference to the local path:
jobs:
deploy-local:
uses: ./.github/workflows/spinup-deploy.yml
with:
theme: 'my-theme'
secrets: inheritYour calling repository should have this structure:
├── web/
│ └── app/
│ └── themes/
│ └── your-theme-name/
│ ├── resources/
│ │ └── assets/
│ │ ├── config.json
│ │ └── config.production.json
│ ├── yarn.lock
│ └── package.json
├── composer.json
└── .github/
└── workflows/
└── deploy.yml
In the Studio-Lemon/workflows repository, add these secrets:
WORKFLOW_SATISPRESS_TOKEN: Your default Satispress token (used as fallback)
In each repository that uses this workflow, add these secrets:
SSH_KEY: SSH private key for deployment serverSSH_USER: SSH username for deployment serverSSH_HOST: SSH hostname for deployment serverSATISPRESS_TOKEN: (Optional) Override token if different from workflow repo token
| Input | Description | Required | Default |
|---|---|---|---|
theme |
Theme name (e.g. 'lemon-theme') | No | Auto-detected from web/app/themes/ |
php_version |
PHP version to use | No | '8.3' |
node_version |
Node.js version to use | No | 'lts/*' |
| Secret | Description | Required |
|---|---|---|
SSH_KEY |
SSH private key for deployment | Yes |
SSH_USER |
SSH username for deployment | Yes |
SSH_HOST |
SSH hostname for deployment | Yes |
SATISPRESS_TOKEN |
Satispress authentication token | No* |
*Falls back to WORKFLOW_SATISPRESS_TOKEN from workflows repository if not provided
- Checkout the calling repository
- Auto-detect theme from
web/app/themes/directory (unless specified) - Setup PHP with specified version
- Install Composer dependencies with Satispress authentication
- Rsync Composer files to server (excluding theme directory)
- Setup Node.js and install Yarn dependencies
- Build assets (copies
config.production.jsontoconfig.jsonand runsyarn production) - Deploy theme via rsync to server
- Clear cache using SpinupWP CLI
- Use
secrets: inheritwhen calling from the same organization - The workflow expects a
config.production.jsonfile that gets copied toconfig.jsonduring build - Theme auto-detection finds the first directory in
web/app/themes/ - If no SATISPRESS_TOKEN is provided, authentication is skipped with a warning
- The workflow runs
wp spinupwp cache purge-siteto clear caches after deployment
This README is intentionally concise — edit as needed for your org's conventions.