Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/job.ts>Job#services

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
method Job.prototype.services
import { Job } from "https://deno.land/x/actionify@0.3.0/src/job.ts";

::: Note

If your workflows use Docker container actions, job containers, or service containers, then you must use a Linux runner:

  • If you are using GitHub-hosted runners, you must use an Ubuntu runner.
  • If you are using self-hosted runners, you must use a Linux machine as your runner and Docker must be installed.

:::

Used to host service containers for a job in a workflow. Service containers are useful for creating databases or cache services like Redis. The runner automatically creates a Docker network and manages the life cycle of the service containers.

If you configure your job to run in a container, or your step uses container actions, you don't need to map ports to access the service or action. Docker automatically exposes all ports between containers on the same Docker user-defined bridge network. You can directly reference the service container by its hostname. The hostname is automatically mapped to the label name you configure for the service in the workflow.

If you configure the job to run directly on the runner machine and your step doesn't use a container action, you must map any required Docker service container ports to the Docker host (the runner machine). You can access the service container using localhost and the mapped port.

For more information about the differences between networking service containers, see "About service containers."

Type Parameters

Services extends string

Parameters

services: WithContext<Record<Services, ContainerProps>, Base, "jobs:jobId:services" | "jobs:jobId:services:serviceId:credentials" | "jobs:jobId:services:serviceId:env:envId">

Returns

Job<CombineAsUnion<Base | { services: Services; }>>