CI/CD
Deploy to Virke from any CI system using the CLI and an API key. For GitHub Actions, use the official virke-deploy composite action.
For zero-config GitHub deployments, see GitHub Integration — connect a repo and get auto-deploy on push and preview per PR with no workflow files.
GitHub Actions (Recommended)
Deploy on push to main
Create .github/workflows/deploy.yml:
name: Deploy to Virke
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Deploy to Virke
uses: virke/virke-deploy@v1
with:
api-key: ${{ secrets.VIRKE_API_KEY }}
Preview on pull request
name: Preview Deploy
on:
pull_request:
types: [opened, synchronize]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Deploy preview
id: preview
uses: virke/virke-deploy@v1
with:
api-key: ${{ secrets.VIRKE_API_KEY }}
preview: "true"
- name: Comment PR with preview URL
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Preview deployed: ${{ steps.preview.outputs.url }}`
})
Action inputs
| Input | Required | Default | Description |
|---|---|---|---|
api-key |
Yes | — | Virke API key |
api-url |
No | https://api.virke.dev |
API base URL (for self-hosted) |
project-dir |
No | . |
Directory containing virke.toml |
preview |
No | false |
Deploy to preview URL |
no-build |
No | false |
Skip the build step |
bun-version |
No | latest |
Bun version to install |
Action outputs
| Output | Description |
|---|---|
url |
The deployment URL |
deploy-id |
The deployment ID |
Monorepo support
jobs:
deploy-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- uses: virke/virke-deploy@v1
with:
api-key: ${{ secrets.VIRKE_API_KEY }}
project-dir: "apps/frontend"
deploy-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- uses: virke/virke-deploy@v1
with:
api-key: ${{ secrets.VIRKE_API_KEY }}
project-dir: "apps/api"
Other CI Systems
Generic pattern
export VIRKE_API_KEY="vk_your_api_key_here"
bun install -g @virke/cli
virke deploy
GitLab CI
# .gitlab-ci.yml
deploy:
image: oven/bun:latest
stage: deploy
script:
- bun install
- bun install -g @virke/cli
- virke deploy
variables:
VIRKE_API_KEY: $VIRKE_API_KEY
only:
- main
preview:
image: oven/bun:latest
stage: deploy
script:
- bun install
- bun install -g @virke/cli
- virke deploy --preview
variables:
VIRKE_API_KEY: $VIRKE_API_KEY
only:
- merge_requests
CircleCI
# .circleci/config.yml
version: 2.1
jobs:
deploy:
docker:
- image: oven/bun:latest
steps:
- checkout
- run: bun install
- run: bun install -g @virke/cli
- run: virke deploy
workflows:
deploy:
jobs:
- deploy:
filters:
branches:
only: main
API Key Management
Create an API key
- Go to Dashboard > Settings > API Keys
- Click "Create API Key"
- Name it (e.g., "GitHub Actions - my-app")
- Copy the key (shown only once)
Store the key in CI
- GitHub Actions: Repository Settings > Secrets > New repository secret, name:
VIRKE_API_KEY - GitLab CI: Settings > CI/CD > Variables (masked, protected)
- CircleCI: Project Settings > Environment Variables
Security best practices
- One key per pipeline — don't share keys between repositories
- Use secrets — never hardcode API keys in workflow files
- Rotate regularly — rotate after team member changes
Further Reading
- GitHub Integration — Zero-config auto-deploy and preview per PR
- Getting Started — Initial setup and first deployment
- Self-Hosted — CI/CD with self-hosted instances
- CLI Commands — Full CLI reference