Skip to main content
Job services run one-off tasks, batch processing jobs, database migrations, and scheduled workloads. Unlike servers, jobs complete and exit after their task finishes.
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: migrations
spec:
  type: job
  repo: acme/api
  build:
    context: db
    dockerfile: db/Dockerfile

Build from Dockerfile

Build your application from a Dockerfile in your GitHub repository.
kind: Service
metadata:
  name: migrations
spec:
  type: job
  repo: acme/api
  build:
    context: db               # relative to repo root
    dockerfile: db/Dockerfile # relative to repo root
    args:
      NODE_ENV: production

Build from Source Code

Use Nixpacks buildpack to automatically detect and build your application from source code.
kind: Service
metadata:
  name: migrations
spec:
  type: job
  repo: acme/api
  build:
    context: db            # relative to repo root
    buildpack: nixpack
    command: npm run build

Use Public Images

Deploy pre-built Docker images from public registries. Use the full image reference including the registry domain. From Docker Hub:
kind: Service
metadata:
  name: backup
spec:
  type: job
  image: postgres
From other public registries:
kind: Service
metadata:
  name: custom-job
spec:
  type: job
  image: ghcr.io/owner/repo

Use Private Images

Deploy images from private registries. First, connect your private registry through Settings in the Ryvn Dashboard, then reference it by name.
kind: Service
metadata:
  name: custom-job
spec:
  type: job
  image: ghcr.io/acme/job
  registry: acme-ghcr     # registry name on ryvn

Properties

name

string — required Service identifier. Must be lowercase, alphanumeric with hyphens only.
name: migrations

type

string — required Must be job.
type: job

repo

string — conditional GitHub repository in owner/repo format. Required when using build.
repo: acme/api

image

string — conditional Docker image reference (e.g., postgres or ghcr.io/acme/job). Required when not using build.
image: postgres

registry

string — optional Registry name for private images.
registry: ghcr

build.branches

array — optional List of branches that trigger releases on push. Each entry has a name and optional args (build arguments specific to that branch). When configured, pushing to any listed branch builds and releases the service automatically. Installations can then track a specific branch using the branch field. Mutually exclusive with promotionPipeline.
build:
  branches:
    - name: main
    - name: staging

promotionPipeline

string — optional Name of promotion pipeline to follow for automated release promotion.
promotionPipeline: main-pipeline

maintenanceWindow

string — optional Maintenance window for this service. Automated deployments will only occur during specified intervals.
maintenanceWindow: overnight

build.context

string — required Build context path relative to repository root. Required when using build.
build:
  context: jobs

build.dockerfile

string — conditional Path to Dockerfile relative to repository root. Required unless using build.buildpack.
build:
  dockerfile: jobs/Dockerfile

build.buildpack

string — optional Buildpack to use for automatic builds. Must be nixpack. Cannot be used with build.dockerfile.
build:
  buildpack: nixpack

build.args

object — optional Build arguments as key-value pairs passed to Docker build.
build:
  args:
    PYTHON_VERSION: "3.11"
    ENV: production

build.command

string — optional Build command to run. Only valid when using build.buildpack.
build:
  command: npm run build

Examples

Monorepo with server and job:
# api.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: api
spec:
  type: server
  repo: acme/monorepo
  build:
    context: backend
    dockerfile: backend/Dockerfile

# migrations.service.yaml
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: migrations
spec:
  type: job
  repo: acme/monorepo
  build:
    context: backend
    dockerfile: backend/migrations/Dockerfile
Scheduled data processing:
# yaml-language-server: $schema=https://api.ryvn.app/v1/schemas/resources.json
kind: Service
metadata:
  name: daily-report
spec:
  type: job
  repo: acme/analytics
  build:
    context: jobs
    dockerfile: report-generator/Dockerfile
    args:
      REPORT_TYPE: daily