Thin Caller & Reusable Workflow
A service repo does not contain deploy logic. It contains a thin caller — a small GitHub Actions workflow that invokes the reusable workflow_call in the ops repo. All the real work happens in the reusable workflow and the orchestrator. You don't write the caller by hand — foundry generate callers emits it from the central platform.json.
The reusable workflow
The ops repo's .github/workflows/deploy.yml is a reusable workflow. Its inputs:
| Input | Required | Default | Description |
|---|---|---|---|
service | yes | — | Service key in platform.json (e.g. web) |
environment | no | prod | Environment to deploy (maps to a branch in the manifest) |
What it does
- Checks out the caller repo.
- Mints a short-lived GitHub App token scoped to read the ops repo.
- Checks out the ops repo (manifest + orchestrator).
- Reads
platform.jsonto resolve the service's AWSroleArnandregion. - Sets up Node + corepack + OpenTofu.
- Configures AWS credentials via OIDC (assumes the resolved role — no long-lived keys).
- Runs the orchestrator against the checked-out caller repo.
The generated caller
For a service web at path app on branch main, foundry generate callers writes .github/workflows/deploy.yml:
name: "Deploy: web"
# Thin caller - generated by `foundry generate callers` from the central
# platform.json. The ops repo owns the pipeline; this repo names the service.
on:
push:
branches: [main]
paths: ['app/**', '.github/workflows/deploy.yml']
workflow_dispatch:
concurrency:
group: foundry-deploy-web-${{ github.ref }}
cancel-in-progress: false
permissions:
id-token: write
contents: read
jobs:
deploy:
uses: your-org/your-ops-repo/.github/workflows/deploy.yml@main
with:
service: web
environment: prod
secrets: inherit- Trigger —
pushto the service's branch (from its environments override), path-scoped to its subdir when it has one, plusworkflow_dispatch. - uses — the reusable ref is derived from the manifest (
<org>/<ops-repo>/.github/workflows/deploy.yml@<ref>), not hard-coded to one org. - secrets: inherit — forwards the org-level secrets (the GitHub App credentials) the reusable workflow needs.
- File name —
deploy.ymlfor a repo's only orchestrated service, ordeploy-<service>.ymlwhen a repo has several.
No deploy steps, no AWS wiring, no strategy logic live in the service repo.