CI/CD: workflow files
CI/CD runs an app's or function's own workflow files on our build machines inside Iran: tests, checks, builds, releases, anything a script does. Each step runs in its own isolated sandbox.
Workflow files#
A workflow file is a YAML file in the repository, in either of two folders. Their syntax is compatible with GitHub Actions' workflow syntax, so a file written for it runs here as it is, within what this page lists. The file is always read at the commit the run is for.
| Folder | The file's name in the API and the CLI |
|---|---|
.cloudhost/pipelines/*.yml (.yaml) | its name: checks.yml |
.github/workflows/*.yml (.yaml) | its path: .github/workflows/ci.yml |
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
workflow_dispatch:
inputs:
suite:
default: unit
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [22, 24]
services:
db:
image: postgres:17
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
- run: npm ci && npm test -- --suite ${{ inputs.suite || 'unit' }}
env:
API_TOKEN: ${{ secrets.API_TOKEN }} # DATABASE_URL is set for db
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
retention-days: 14What starts a run#
| `on:` | What it does |
|---|---|
push | A push to the app's or function's repository (our git address or a connected repository), with branches and tags filters and their -ignore forms. paths and paths-ignore are accepted, and every push passes them. |
workflow_dispatch | A manual run from the dashboard, the CLI, the API or MCP, with the file's inputs. Inputs are checked only for shape when the run starts (400 bad_inputs); a wrong one stops the run before its jobs start. |
schedule | cron in UTC, on production only, from its latest push. A run more than 10 minutes late is not started. |
| other events | Accepted, so the file is not refused, and they start no run. |
A run is at a commit already pushed; a branch with nothing pushed yet answers 409 no_source. The file's concurrency is per app or function: a newer run waits for the group's running one and replaces one already waiting; cancel-in-progress cancels the running one.
What a workflow file may use#
| Key | |
|---|---|
name, run-name, env, concurrency | The file's and each run's name, environment variables, and the concurrency group (above) |
jobs.<id> | name, needs, if, runs-on, env, outputs, timeout-minutes, continue-on-error, services, strategy, steps. A job's own concurrency is accepted and not applied. |
strategy | matrix with include and exclude, fail-fast and max-parallel |
steps[] | name, id, if, run, working-directory, env, uses, with, timeout-minutes, continue-on-error |
${{ }} | Expressions and their contexts. secrets.NAME is the project's secret of that name (Secrets), masked in the log; vars is always empty. |
$GITHUB_OUTPUT, $GITHUB_STEP_SUMMARY | A step's and a job's outputs, and the job's summary, shown with the run |
runs-on | Any Linux x64 label (ubuntu-latest, ubuntu-24.04, a list): every job runs on the same kind of build machine. Windows and macOS are refused. |
container | Refused: the steps run on the build machine's image, and the setup-* actions give other tool versions. |
The actions `uses:` accepts#
uses: takes only our own maintained copies and composite actions in the same repository, and none is fetched from anywhere. A file names them as it always does, e.g. uses: actions/checkout@v4, pinned by @v* or a full commit SHA.
| Action | |
|---|---|
actions/checkout | The run's commit |
actions/setup-node, actions/setup-go, actions/setup-python | A tool version the build machines carry (below) |
actions/cache, actions/cache/restore, actions/cache/save | Caches, per app or function, by key and paths; saving a key that exists replaces it |
actions/upload-artifact, actions/download-artifact | A run's artifacts: a name once a run (409 unless overwrite: true), kept 1 to 30 days (retention-days), 7 by default |
./path/to/action | A composite action (action.yml with runs.using: composite) in the same repository, up to 5 deep |
Any other uses: is refused: the run fails before its jobs start, with a message naming the step and the action, and nothing is fetched. An unknown input to one of our actions only warns.
Tool versions the build machines carry: Node.js 22, 24 and 26, Go 1.27 and Python 3.13. A setup-* step for a version not carried fails, and its message names the versions that are. For Go, a go.mod whose go line is older than 1.27 is built by Go 1.27.
A SQL database and a cache beside the job#
Each job has up to 3 services: a SQL database or a cache, as workflow files already write them (image: postgres:17, image: redis:8). Steps reach each service by its name or localhost and get its address in environment variables: <NAME>_URL for each service, DATABASE_URL for the first SQL database and CACHE_URL for the first cache.
- Any SQL database image tag runs our current version.
POSTGRES_USERandPOSTGRES_DBare honoured, and any password is accepted. - Other service images are refused.
Runs, jobs and steps#
A run is a set of jobs: first the (plan) job, which reads the file and checks it, then the file's jobs as their needs allow. Matrix legs are made when the job is ready, and a job's if and matrix are worked out then, without secrets. The dashboard shows the jobs graph, each step's live log, the summaries and the artifacts.
cloudhost apps pipelines files shop --branch new-menu
cloudhost apps pipelines run shop .github/workflows/ci.yml --branch new-menu --input suite=e2e
cloudhost apps pipelines runs shop --file .github/workflows/ci.yml
cloudhost apps pipelines show shop '#12'
cloudhost apps pipelines logs shop '#12' <step>
cloudhost apps pipelines rerun shop '#12'
cloudhost apps pipelines download shop '#12' dist --output dist.tar.gz- Reading is any role; starting, cancelling and rerunning need owner, admin or developer. Agent's key sees and starts preview runs only (a branch other than production's).
- Cancelling a run cancels its
always()jobs too, and steps the cancel kept from running show as skipped. - A rerun starts a new run with the same file, commit and inputs.
- The routes are the same for apps and functions (
appsorfunctions); the details are in the API reference.
What is refused#
These are refused with a message naming their line, before any job runs:
- Any action but our copies and composite actions in the same repository; local JavaScript and Docker actions.
- A job's
container:, and Windows and macOS runners. - Secrets inside a composite action, and a secret by a computed name (only
secrets.NAME). - Checkout of another repository or with
path. - A service with an image other than the SQL database and the cache.
- Setting
PATH,NODE_OPTIONS, our reserved names orGITHUB_*andRUNNER_*through$GITHUB_ENV.
Limits#
| Limit | |
|---|---|
| Jobs in a file and a run, matrix legs included | 256 |
| Legs in one matrix | 256 |
| Steps in a job | 50 |
| Services in a job | 3 |
| Workflow files in a push | 50 |
| A workflow file's size | 256 KB |
| A step | 120 minutes (timeout-minutes may set less) |
| A job | 180 minutes (timeout-minutes may set less) |
| Artifacts kept | 1 to 30 days, 7 by default |
| Inputs of a manual run | 25 |
Pricing#
Each job's running time is counted per project and shows on the bill as CI/CD minutes, beside build minutes. The price per unit is on the pricing page. A run's jobs share the team's concurrent builds with its builds (Builds), and use comes out of the month's credit first, then the wallet (Billing).