Skip to content

Deployments

Trigger and manage deployment workflow runs programmatically — from CI/CD pipelines, release scripts, or any system that can make an HTTP request.


List Workflows

http
GET /api/v1/deployments

Returns all deployment workflows defined in your organization.

json
{
  "data": [
    {
      "id": "01j9wf...",
      "name": "Production Deploy",
      "server_id": "01j9k1abc...",
      "last_run_at": "2025-11-15T13:30:00Z",
      "last_run_status": "success"
    }
  ]
}

Trigger a Workflow Run

http
POST /api/v1/deployments/{workflow-id}/run
Authorization: Bearer <token>

Response 202 Accepted:

json
{
  "run_id": "01j9run...",
  "status": "queued",
  "message": "Deployment queued. Use the run_id to poll for status."
}

Execution begins immediately. To receive real-time output, connect to the WebSocket stream for this conversation.


Get a Run Result

http
GET /api/v1/deployments/{workflow-id}/runs/{run-id}
json
{
  "data": {
    "id": "01j9run...",
    "status": "success",
    "triggered_by": "API token: GitHub Actions — Production",
    "started_at": "2025-11-15T14:00:00Z",
    "completed_at": "2025-11-15T14:02:34Z",
    "duration_seconds": 154,
    "steps": [
      {
        "name": "Pull latest code",
        "status": "success",
        "output": "Already up to date."
      },
      {
        "name": "Install dependencies",
        "status": "success",
        "output": "All packages installed in 12s"
      }
    ]
  }
}

CI/CD Integration

GitHub Actions

yaml
name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger RasnuCloud Deployment
        run: |
          curl -s -X POST ${{ secrets.RASNUCLOUD_URL }}/api/v1/deployments/${{ secrets.RASNUCLOUD_WORKFLOW_ID }}/run \
            -H "Authorization: Bearer ${{ secrets.RASNUCLOUD_API_TOKEN }}" \
            -H "Content-Type: application/json"

GitLab CI

yaml
deploy:
  stage: deploy
  script:
    - |
      curl -s -X POST $RASNUCLOUD_URL/api/v1/deployments/$RASNUCLOUD_WORKFLOW_ID/run \
        -H "Authorization: Bearer $RASNUCLOUD_API_TOKEN"
  only:
    - main

Any CI/CD system that can make an HTTP request works identically.

Released under the MIT License.