Github Actions
Use the tapitalee/ghactions repository to integrate Tapitalee into your GitHub CI/CD workflows.
For a real-world example of these workflows in action, see the bigdemo workflows.
Set up TAPIT_TOKEN secret
All actions require a TAPIT_TOKEN secret to authenticate with Tapitalee.
Create a Deploy Token in Tapitalee:
$ tapit create deploy_token description='github'Copy the token into a GitHub Secret under
Settings > Secrets and variables > Actions > New Repository Secret, naming it TAPIT_TOKEN.
Available Actions
tapitalee/ghactions/setup-tapit
Installs the Tapit CLI. Used internally by all other actions — you typically don’t need to call this directly.
tapitalee/ghactions/image-build
Builds a container image using Tapit and pushes it to your image repository. Does not deploy.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name (defaults to deploy token’s linked app) | No |
docker_tag | Docker tag (defaults to short git SHA) | No |
dockerfile | Path to Dockerfile | No |
cache | Cache mode (gha or ecr) | No |
tapitalee/ghactions/image-deploy
Builds and deploys a container image. If the image already exists, it creates a deploy from it; otherwise it builds and deploys in one step.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name (defaults to deploy token’s linked app) | No |
docker_tag | Docker tag (defaults to short git SHA) | No |
dockerfile | Path to Dockerfile | No |
cache | Cache mode (gha or ecr) | No |
tapitalee/ghactions/create-deploy
Deploys an already-built image — no build step. Use this when you’ve built the image in a prior step or workflow.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name (defaults to deploy token’s linked app) | No |
docker_tag | Docker tag (defaults to short git SHA) | No |
tapitalee/ghactions/image-login
Logs Docker into your Tapitalee image repository (ECR). Useful when you want to push images manually using Docker commands.
Outputs repository_url — the ECR repository URL.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name (defaults to deploy token’s linked app) | No |
tapitalee/ghactions/create-release
Creates a Tapitalee release record, optionally with release notes, a diff URL, and a release URL.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name (defaults to deploy token’s linked app) | No |
docker_tag | Docker tag (defaults to short git SHA) | No |
git_tag | Git tag to associate with the release | No |
release_notes | Multi-line release notes | No |
diff_url | URL to the diff | No |
release_url | URL to the release page | No |
tapitalee/ghactions/create-task
Runs a one-off command (e.g. a database migration) as a Tapitalee task and waits for it to complete.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
command | Command to run | Yes |
memory | Memory in GB (default: 2) | No |
cpu | CPU in cores (default: 0.25) | No |
app_name | App name (defaults to deploy token’s linked app) | No |
docker_tag | Docker tag (defaults to short git SHA) | No |
tapitalee/ghactions/create-preview
Creates a preview app from the current app.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
preview_app_name | Name for the preview app | Yes |
app_name | Source app name | No |
delete_in_days | Auto-delete after this many days | No |
domain | Domain to attach to the preview app | No |
tapitalee/ghactions/delete-preview
Deletes a preview app.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
preview_app_name | Name of the preview app to delete | Yes |
app_name | Source app name | No |
tapitalee/ghactions/wait-for-addons
Waits until all add-ons for an app are ready. Useful after creating a preview app before deploying to it.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
app_name | App name | No |
tapitalee/ghactions/await
Polls a tapit command and waits until a condition on all records becomes true. Useful for waiting on deploys, tasks, or other async operations.
| Input | Description | Required |
|---|---|---|
tapit-token | Deploy token | Yes |
args | Arguments to pass to the tapit command | Yes |
all | JSON condition to match on all records, e.g. {"status": "complete"} | Yes |
app_name | App name | No |
Example Workflows
Build & Deploy on push to main
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & Deploy
uses: tapitalee/ghactions/image-deploy@main
with:
tapit-token: ${{ secrets.TAPIT_TOKEN }}Build image only (no deploy)
# .github/workflows/build.yml
name: Build
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Image
uses: tapitalee/ghactions/image-build@main
with:
tapit-token: ${{ secrets.TAPIT_TOKEN }}Build, then deploy separately
Useful when you want to run tests between building and deploying.
# .github/workflows/deploy.yml
name: Build, Test & Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tapitalee/ghactions/image-build@main
with:
tapit-token: ${{ secrets.TAPIT_TOKEN }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tapitalee/ghactions/create-deploy@main
with:
tapit-token: ${{ secrets.TAPIT_TOKEN }}Run a task (e.g. database migration)
# .github/workflows/migrate.yml
name: Run Migration
on:
workflow_dispatch:
inputs:
command:
description: 'Command to run'
required: true
type: string
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Task
uses: tapitalee/ghactions/create-task@main
with:
tapit-token: ${{ secrets.TAPIT_TOKEN }}
command: ${{ inputs.command }}