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#runsOn

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

Use .runsOn() to define the type of machine to run the job on. The machine can be either a GitHub-hosted runner or a self-hosted runner. You can provide runs-on as a single string or as an array of strings. If you specify an array of strings, your workflow will run on a self-hosted runner whose labels match all of the specified runs-on values, if available. If you would like to run your workflow on multiple machines, use .strategy().

import { workflow, Runner } from 'https://deno.land/x/actionify@0.3.0/mod.ts';

const ci = workflow({ name: 'ci' })
  .job('setup', job => job.runsOn(Runner.UbuntuLatest))

Choosing self-hosted runners

To specify a self-hosted runner for your job, configure runs-on in your workflow file with self-hosted runner labels.

All self-hosted runners have the self-hosted label. Using only this label will select any self-hosted runner. To select runners that meet certain criteria, such as operating system or architecture, we recommend providing an array of labels that begins with self-hosted (this must be listed first) and then includes additional labels as needed. When you specify an array of labels, jobs will be queued on runners that have all the labels that you specify.

Although the self-hosted label is not required, we strongly recommend specifying it when using self-hosted runners to ensure that your job does not unintentionally specify any current or future GitHub-hosted runners.

import { workflow, Runner } from 'https://deno.land/x/actionify@0.3.0/mod.ts';

const ci = workflow({ name: 'ci' })
  .job('setup', job => job.runsOn(['self-hosted', 'linux']));

Parameters

runsOn: WithContext<RunsOnOptions, Base, "jobs:jobId:runsOn">