Deploy to RaidFrame from GitHub Actions CI/CD pipelines.
Add this workflow to .github/workflows/deploy.yml:
name: Deploy to RaidFrame
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to RaidFrame
uses: raidframe/deploy-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
project: my-saas
environment: production
| Input | Required | Default | Description |
|---|---|---|---|
token | Yes | — | RaidFrame API token |
project | No | Auto-detect | Project name |
environment | No | production | Target environment |
service | No | All | Specific service to deploy |
wait | No | true | Wait for healthy deployment |
timeout | No | 300 | Deploy timeout in seconds |
canary | No | — | Canary percentage (e.g., 10) |
| Output | Description |
|---|---|
deployment_id | Deployment ID |
url | Deployment URL |
version | Deployment version |
name: Deploy Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: raidframe/deploy-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
environment: production
name: Deploy Preview
on:
pull_request:
types: [opened, synchronize]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: raidframe/deploy-action@v1
id: deploy
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
environment: preview
- name: Comment PR with 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.deploy.outputs.url }}`
})
name: CI/CD
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
- run: npm run lint
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: raidframe/deploy-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
name: Canary Deploy
on:
push:
branches: [main]
jobs:
canary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy Canary (10%)
uses: raidframe/deploy-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
canary: 10
- name: Wait and Monitor
run: sleep 600 # 10 minutes
- name: Promote to 100%
uses: raidframe/canary-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
action: promote
percent: 100
- name: Run Migrations
uses: raidframe/exec-action@v1
with:
token: ${{ secrets.RAIDFRAME_TOKEN }}
service: web
command: "npx prisma migrate deploy"
rf auth token create --name "GitHub Actions" --scope deploy,env:read --expires 365d
Add the token as a GitHub repository secret named RAIDFRAME_TOKEN.
For infrastructure-as-code workflows:
terraform init
terraform {
required_providers {
raidframe = {
source = "raidframe/raidframe"
version = "~> 1.0"
}
}
}
provider "raidframe" {
token = var.raidframe_token
}
resource "raidframe_project" "main" {
name = "my-saas"
region = "us-east-1"
}
resource "raidframe_service" "web" {
project = raidframe_project.main.id
name = "web"
type = "web"
port = 3000
scaling {
min = 2
max = 20
}
resources {
plan = "pro"
}
}
resource "raidframe_database" "main" {
project = raidframe_project.main.id
name = "main"
engine = "postgres"
version = "16"
plan = "pro"
}