Deploy your static sites and built applications to Static.app directly from GitHub Actions.
- 🚀 Easy deployment - Deploy static sites with a single action
- 🔧 Build support - Automatically build your application before deployment
- 🆕 Create or update - Create new sites or update existing ones
- 📦 Smart packaging - Automatically excludes unnecessary files
- 🎯 Flexible - Works with any static site generator or build tool
name: Deploy to Static.app
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to Static.app
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: './'
name: Deploy Built App
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to Static.app
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'dist'
build-command: 'npm run build'
install-command: 'npm ci'
node-version: '18'
name: Update Existing Site
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to Static.app
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
pid: 'ols2my1htk'
build-dir: 'build'
build-command: 'npm run build'
Input | Description | Required | Default |
---|---|---|---|
api-key |
Your Static.app API key | ✅ | - |
pid |
Project PID to update (find in Site → Settings → General) | ❌ | - |
build-dir |
Directory to deploy | ❌ | ./ |
build-command |
Build command to run before deployment | ❌ | - |
install-command |
Install command to run before build | ❌ | npm ci |
node-version |
Node.js version to use | ❌ | 18 |
exclude |
Files/directories to exclude (comma-separated) | ❌ | node_modules,.git,.github,*.md,package*.json |
Output | Description |
---|---|
site-url |
The URL of the deployed site |
deploy-url |
The deployment URL |
- Go to Static.app
- Sign in to your account
- Navigate to Account → API Keys
- Create a new API key
- Copy the generated key (starts with
sk_
)
- Go to your GitHub repository
- Navigate to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
STATIC_APP_API_KEY
- Value: Your API key from Static.app
- Click Add secret
Create .github/workflows/deploy.yml
in your repository:
name: Deploy to Static.app
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy to Static.app
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
# Add other inputs as needed
- name: Deploy React App
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'build'
build-command: 'npm run build'
install-command: 'npm ci'
- name: Deploy Vue App
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'dist'
build-command: 'npm run build'
- name: Deploy Next.js App
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'out'
build-command: 'npm run build && npm run export'
- name: Deploy Gatsby Site
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'public'
build-command: 'npm run build'
- name: Deploy Hugo Site
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: 'public'
build-command: 'hugo --minify'
install-command: 'echo "No npm install needed"'
- name: Deploy Jekyll Site
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
build-dir: '_site'
build-command: 'bundle exec jekyll build'
install-command: 'bundle install'
- name: Deploy with Custom Exclusions
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
exclude: 'node_modules,.git,*.log,temp,cache'
strategy:
matrix:
node-version: [16, 18, 20]
- name: Deploy with Node ${{ matrix.node-version }}
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
node-version: ${{ matrix.node-version }}
- name: Deploy to Static.app
id: deploy
uses: designmodo/[email protected]
with:
api-key: ${{ secrets.STATIC_APP_API_KEY }}
- name: Comment PR with Deploy URL
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚀 Deployed to: ${{ steps.deploy.outputs.site-url }}'
})
❌ "API key is required"
- Make sure you've added
STATIC_APP_API_KEY
to your repository secrets - Verify the secret name matches exactly
❌ "Build command failed"
- Check your build command syntax
- Ensure all dependencies are properly installed
- Verify the build directory exists after the build
❌ "Invalid API key"
- Regenerate your API key in Static.app dashboard
- Update the GitHub secret with the new key
❌ "Site not found"
- If using
pid
, make sure the project exists and you have access - Remove
pid
to create a new site instead
Enable debug logging by adding this to your workflow:
env:
ACTIONS_STEP_DEBUG: true
MIT License - see LICENSE file for details.
Made with ❤️ by the Static.app team