Nov 17, live webinar: ECS to EKS without freezing the roadmap for a quarter

Where should coding agents' pull requests get built and deployed? Splitting CI, builds and preview environments in 2026

Coding agents multiply pull requests, and every one pays for tests, an image build and a deploy. Here is where each step should run, how to cut CI minutes, how to give agents build logs they can act on, how to scope what they may deploy, and how to stop preview environments from running forever.

Romaric Philogene
CEO & Co-founder
NOV 17, 2026 · 17 MIN
Where should coding agents' pull requests get built and deployed? Splitting CI, builds and preview environments in 2026

Key points:

  • Every agent pull request pays three times: CI for tests, an image build, and a deploy if you want a live environment. Agents push small commits often, so each of those costs repeats per push, not per pull request.
  • Split the work by what each step needs. Tests belong in CI (GitHub Actions or a faster runner). The image build and the per-PR environment belong next to where the app will run, on Kubernetes in your own cloud account. Building the same image in CI and again in the deploy tool is the most common waste I see.
  • Agents fix what they can read. Give them per-step build logs and deployment status through an API or MCP server, so "the preview failed" turns into "step 7 of the Dockerfile failed with this error" and the agent pushes the fix itself.
  • Scope what an agent may deploy with a policy instead of a role. Qovery API Policy Tokens evaluate every API call against a Rego policy (deny by default), and the MCP Server is read-only unless you opt into write access.
  • Preview environments need an end date. Delete on merge or close, stop on a schedule, and create on demand for pull requests a human will test.

Qovery · Infrastructure control plane
Build with Claude Code, Deploy with Qovery
Learn more

Since coding agents started opening pull requests on our customers' repositories, I get the same two questions every week. "Our GitHub Actions bill went up a lot, where do the minutes go?" And "where should Claude Code's pull requests get deployed so someone can try them?"

They are the same question. An agent pull request is cheap to write and expensive to verify. Each push runs your tests, often builds a Docker image, and, if you want a reviewer to click around, deploys an environment. The agent does not get tired of pushing, so the pipeline that was sized for humans gets hit far more often.

How much more is hard to pin down, and I won't invent a number. GitHub publishes some figures. Octoverse 2025 counted 43.2 million pull requests merged per month (+23% year over year), nearly 1 billion commits pushed in 2025 (+25.1%), and more than 1 million pull requests created by the Copilot coding agent between May and September 2025 alone. Your own repository will tell you more than any industry figure, and I show how to measure it below.

If you want the step-by-step wiring of anthropics/claude-code-action with preview environments, read Claude Code + GitHub Actions: deploy every Claude PR to its own environment. If you want workflow tuning, read 20 ways to speed up GitHub Actions, whose section 12 covers limits on agent triggers. Here I cover which step should run where, and what feedback the agent needs to close the loop on its own.

Why does every agent pull request cost you more than a human one?

An agent pull request costs more because the agent pushes more often and every push restarts the whole pipeline, including the parts that only matter once: the image build and the deploy. A human pushes a few times and waits. An agent pushes a fix for every failing check, within minutes.

Here is what one push typically triggers on a team that builds and deploys from GitHub Actions:

StepTypical place todayBilled asNeeded on every push?
Lint and type checksGitHub ActionsCI minutes, rounded up per jobYes, cheap and fast
Unit and integration testsGitHub ActionsCI minutesYes
Docker image buildGitHub Actions, often on a larger runnerCI minutes at the larger runner's rateOnly once per commit that will be deployed
Push to registryGitHub ActionsCI minutes plus registry storageOnly with a build
Deploy a preview environmentGitHub Actions running Terraform, Helm or kubectlCI minutes plus cluster computeOnly when someone will look at it
End-to-end tests against the previewGitHub ActionsCI minutesUsually at the end, not on every push
Cleanup on merge or closeA separate workflow, if someone wrote itCI minutes, plus compute for every environment it missedOnce

GitHub rounds each job up to the next whole minute (GitHub runner pricing). A standard 2-core Linux runner costs $0.006 a minute, and the 4-core and 8-core larger runners that teams pick for Docker builds cost $0.012 and $0.022.

Here is an illustration, not a measurement. Picture an agent pull request that receives six pushes before merge, with a 5-minute image build on an 8-core runner each time. That is 30 build minutes, or $0.66 in build compute for one pull request, before tests and deploy steps. Multiply by your own count of agent pull requests per month. The figure per PR is small, but it scales with pushes, and the same image often gets built twice, which I cover below.

How do I find out where our CI minutes go?

Split your Actions usage by who opened the pull request and by job, then compare agent pull requests with human ones. Ten minutes with the GitHub CLI answers most of it.

BASH|Last 200 runs of the CI workflow, with the branch and who triggered it
gh run list --workflow ci.yml --limit 200 \
  --json databaseId,headBranch,event,actor,createdAt,updatedAt,conclusion

Agent branches usually have a recognisable prefix (claude/ for claude-code-action, copilot/ for Copilot's coding agent) and a bot actor. Count runs per pull request for each group, then look at which jobs take the most minutes. Usually two jobs dominate, the test suite and the Docker build. The test suite earns its minutes. The Docker build often runs a second time later, in the deploy tool.

GitHub also shows run time, queue time and failure rate per workflow and job under your organization's Insights, Actions Performance Metrics. Note the failure rate on agent branches. A high one means the agent pushes code that breaks, reads the failure, pushes again. Good feedback shortens that loop, and the section on build logs below shows how.

Where should each step of an agent pull request run?

Run tests in CI, where runners are cheap per minute and parallel. Run the image build and the per-PR environment next to the cluster that will run the app, in your own cloud account, and build each commit once. Run end-to-end tests from CI against the live preview URL.

StepWhere it should runWhy
Lint, types, unit testsGitHub Actions, or a faster runner (Blacksmith, Depot, Namespace)Cheap per minute, parallel, fails fast before anything gets built
Integration tests that need real servicesAgainst the preview environmentThe preview already has the database, queue and secrets wired
Image buildThe deployment platform, on build workers or your own clusterThe build sits next to the deploy, so CI does not build the same image a second time
RegistryYour cloud accountNo registry credentials in CI or in the agent's hands
Preview environment per pull requestKubernetes in your own AWS, GCP, Azure or Scaleway account, or your existing clusterSame runtime as production, same network rules, same data residency
End-to-end testsCI, pointed at the preview URLTests stay in CI and test the real thing
CleanupThe deployment platform, on merge or closeNobody has to remember to write the cleanup workflow

With Qovery, the middle rows happen without a workflow file. Qovery listens to pushes and pull requests through its own Git integration, builds the image from your Dockerfile, pushes it to a registry in your cloud account, deploys it to a clone of a blueprint environment and comments the URL on the pull request. By default the build runs on a pool of Qovery build workers in a separate Kubernetes cluster dedicated to builds; building on your own cluster is an option. The environment itself always runs in your account.

I give teams one rule. If a step needs the production runtime (network, secrets, managed database, Kubernetes), run it where production runs. If it only needs a CPU and your code, run it in CI.

For a deeper comparison of the CI accelerators that fit the first row, I wrote up Blacksmith, Depot, Namespace or Qovery with prices from each vendor's page.

Our GitHub Actions bill doubled since agents started opening PRs. How do we cut CI minutes?

Remove work that agents trigger but nobody needs: duplicate image builds, deploy steps in CI, and full pipelines on pushes that will be superseded a minute later. Then put the remaining minutes on the cheapest runner that is fast enough.

Section 12 of our GitHub Actions speed-up guide covers the agent-specific workflow limits (concurrency groups on agent branches, trigger rules, turn caps, approval before workflows run). I won't repeat it. These are the architecture changes on top of it:

  1. Stop building the deploy image in CI. If your platform builds the image to deploy it, your CI docker build for the same commit is a second build of the same thing. Keep a CI build only if your tests run inside the image, and then make it small.
  2. Move deploy and cleanup out of CI. Terraform, Helm and kubectl jobs in Actions spend most of their minutes waiting for a rollout. A platform that deploys on push waits on its own side.
  3. Run integration tests against the preview, not inside CI. Spinning up Postgres, Redis and a queue in service containers on every push repeats what the preview environment already provides.
  4. Gate end-to-end tests on the preview being ready. Run them once per meaningful push, not on every commit the agent makes while it iterates.
  5. Let the agent run cheap checks before it pushes. With the right tools in its environment, Claude Code or Codex runs the linter and unit tests locally, so fewer red pipelines reach CI.

There is one trade-off. Moving the build to Qovery moves minutes; it does not make them free. Qovery counts build and deploy time as deployment minutes: 1,000 a month on the Free plan, 3,000 on Starter, 8,000 on Growth and 30,000 on Scale, with overage at $0.16 a minute on paid plans (Qovery pricing). That is more per minute than a GitHub-hosted runner. The saving comes from building each commit once, deleting the deploy and cleanup workflows, and not running environments nobody looks at.

Give every agent PR a live environment in your own cloud.
Qovery builds each pull request, deploys it to its own preview environment on Kubernetes in your AWS, GCP, Azure or Scaleway account or your existing cluster, and hands your agent the build logs. Free plan, unlimited AI agents, no credit card.

How do I give coding agents build logs and deploy feedback they can act on?

Give the agent the same structured feedback a senior engineer would look at: which step failed, the error, the duration, and the logs for that exact deployment. Then let it read them through an API or MCP server instead of a screenshot of a red check.

A red "Deploy preview" check on GitHub is nearly useless to an agent. It has to find the run, page through thousands of log lines, and guess which one matters. Agents do much better with structured answers.

Qovery gives the agent three layers:

  • Deployment logs that include the build. The Qovery deployment logs show the build logs when Qovery builds your service, the status of each step while Kubernetes applies it, and a final success or failure with guidance. Qovery keeps logs for the last 20 deployments plus the latest failure (Qovery docs).
  • Per-step build timing and the Build Optimizer. Since 12 November, a first group of customers sees the time of each build step in the deployment logs, and the Build Optimizer reads the Dockerfile, build logs and cache history and proposes a corrected Dockerfile (how we built it).
  • The MCP Server. The Qovery MCP Server lets an agent query environments, services and deployments. Its deployment status tool returns, for each service, the current state, the failing step, the error message and the duration, for the latest deployment or a past one. Its service log tool filters logs by deployment, so the agent reads only what that deployment produced.

The loop then looks like this. The agent pushes. The preview deployment fails. Instead of re-running blindly, the agent asks the MCP Server for the deployment status, sees that the build failed at the step that installs dependencies with a missing native library, adds the package to the Dockerfile and pushes once. If the build succeeds but the app crashes on start, the same tools return the runtime logs of that deployment, and the agent sees the missing environment variable.

I don't have a clean number for how many pushes this saves, so measure it on your own repository by counting pushes per agent pull request before and after you connect the MCP Server.

Keep the MCP Server read-only for this loop, because reading status and logs is all the agent needs to fix code. And keep secrets out of build output, because anything printed to a build log is readable by whoever can read the logs, agents included.

How do I limit what an agent is allowed to deploy?

Give the agent a credential that can do only the job you gave it, enforced on every API call. On Qovery that is an API Policy Token: a token whose permissions come from a Rego policy evaluated by Open Policy Agent, deny by default, instead of a broad role.

Roles bundle permissions. The closest role that lets an agent redeploy a preview often also lets it delete environments or touch production. An API Policy Token decides each request from the action, the target resource, the HTTP method and the request body. You write "this token may deploy and redeploy services in environments whose name starts with [PR], and read logs everywhere in this project", and everything else is refused. Policy changes apply immediately, and actions made with the token show up separately in the audit log, so you can tell the agent from a human or a script. The policy reference lives in the API Policy Tokens documentation.

Here is how I would scope the three kinds of agent access most teams need:

Agent jobAccess it needsHow to give it on Qovery
Fix its own failing pull requestRead deployment status and logs for its previewMCP Server in default read-only mode, over OAuth as the user who runs the agent
Redeploy or restart its previewDeploy actions on [PR] environments onlyAPI Policy Token with a policy limited to those environments
Promote to staging or productionUsually none; a human mergesKeep it in your merge and promotion rules, not in the agent's token

The MCP Server is read-only by default and can only trigger deployments or change configuration when you add it with read_write=true and enable write access in the Console. I recommend starting every agent in read-only mode and adding write access per use case, not per agent. More on why in why AI agents should deploy through a scoped API, not cloud credentials.

How do I stop preview environments for agent PRs from running forever?

Give every preview environment three exits: deletion when the pull request is merged or closed, a stop schedule for nights and weekends, and creation only on demand for pull requests a human will test. Abandoned agent pull requests are the main source of forgotten environments, because nobody feels they own them.

On Qovery:

  • Delete on merge or close. Preview environments are clones of a blueprint environment, created when a pull request opens and deleted when it is merged or closed. You do not write a cleanup workflow.
  • Stop on a schedule. Deployment rules start and stop environments on a schedule, and a [PR]* pattern applies the rule to every preview environment created from a pull request. A stopped preview frees the cluster capacity its services used.
  • Create on demand. With Create on demand turned on, a preview appears only when someone comments /qovery preview on the pull request. For agents that open many exploratory pull requests, this is the setting that saves the most. The flow is described in manually trigger preview environments.
  • Deploy only the services the PR touches. In the preview settings, select the services that should get a preview. A change to the frontend does not need its own worker fleet.

For what one preview environment per agent pull request costs on AWS with real list prices, and how these settings change the monthly bill, see what a preview environment per agent PR really costs.

What is the best CI/CD setup for teams where agents open most pull requests?

The setup that holds up is tests in CI, the image built by the deploy step only (not a second time in CI), a per-PR environment on your own Kubernetes, structured logs the agent can read, and a scoped credential. Several stacks can deliver that; they differ in how much you assemble and maintain.

SetupTestsBuildPer-PR environmentAgent reads build and deploy logsScoped agent accessWho maintains it
GitHub Actions only, deploy scripts in workflowsActionsActionsYour Terraform or Helm jobsThrough raw workflow logsGitHub token permissions, broad on the clusterYour team
Faster runners (Blacksmith, Depot, Namespace) + your deploy scriptsAcceleratorAcceleratorYour Terraform or Helm jobsThrough workflow logs and vendor dashboardsAs aboveYour team plus the vendor for runners
GitHub Actions + Argo CD ApplicationSetsActionsActionsArgo CD pull request generatorThrough Argo CD and workflow logsGit permissions plus Argo CD RBACYour platform team
Frontend preview hosts (Vercel, Netlify)Actions or the hostThe hostFrontend only, on the host's infrastructureHost's APIHost's tokensThe host, but backend previews stay with you
GitHub Actions for tests + Qovery for build, deploy and previewsActions or an acceleratorQoveryFull stack, on your Kubernetes in your cloud accountMCP Server and API: status, failing step, error, logs per deploymentAPI Policy Tokens, read-only MCP by defaultQovery for the platform, your team for the app

Argo CD with ApplicationSets is a strong choice for a team with platform engineers who want everything in Git; we wrote a build sheet for the Argo CD pull request generator. Vercel and Netlify are excellent for frontends and stop at the frontend. Qovery fits teams that want full-stack previews in their own cloud account without hiring someone to build and run the pipeline.

How do I set this up from Claude Code or Cursor?

Install the Qovery Agent Skills and connect the MCP Server, and your coding agent can set up preview environments, read build and deploy status, and troubleshoot failures through the Qovery API. Four commands; run the ones you need.

BASH|1. Agent Skills, global: Claude Code, Cursor, Codex, OpenCode, Gemini CLI and others
curl -fsSL https://skill.qovery.com/install.sh | bash

# 2. Or for the current project only
curl -fsSL https://skill.qovery.com/install.sh | bash -s -- --project

# 3. MCP Server for Claude Code over OAuth, read-only by default
claude mcp add --transport http qovery https://mcp.qovery.com/mcp --callback-port 4242

# 4. Write access, only when you explicitly want it (also needs write access enabled in the Qovery Console)
claude mcp add --transport http qovery "https://mcp.qovery.com/mcp?read_write=true" --callback-port 4242

Your agent asks you to approve the install command. The MCP Server opens an OAuth login in your browser and then acts with your own user permissions. For the feedback loop in this article, command 3 is enough.

Then ask in plain language. "Set up preview environments for this repository with Qovery" uses the qovery-preview skill. "Why did the preview for this pull request fail?" uses the MCP Server and the qovery-troubleshoot skill. "Why are our builds slow?" uses qovery-speedup. The skills deploy and configure; the MCP Server operates what already exists. Start with the AI agent quickstart or the Claude Code integration.

Frequently asked questions
Where should Claude Code's pull requests get built and deployed so each one gets a live environment?

Run the tests in GitHub Actions, and let a deployment platform build the image and deploy each pull request to its own preview environment on Kubernetes in your own cloud account. With Qovery, the preview is a clone of a blueprint environment, its URL is posted on the pull request, and it is deleted on merge or close. The step-by-step wiring with claude-code-action is in our separate how-to.

Our GitHub Actions bill doubled since we started using AI coding agents. How do we cut CI minutes?

Cancel superseded runs on agent branches, stop building the deploy image in CI when your platform builds it again, move deploy and cleanup jobs out of Actions, and run integration tests against the preview environment instead of service containers on every push. Then measure runs per agent pull request with the GitHub CLI to see what changed.

What is the best CI/CD for teams where AI agents open most of the pull requests?

A setup with tests in CI, one image build per commit, a full-stack environment per pull request on your own Kubernetes, logs the agent can read through an API, and a scoped credential for the agent. GitHub Actions plus Argo CD can do it with a platform team. GitHub Actions plus Qovery does it without one, in your AWS, GCP, Azure or Scaleway account or your existing cluster.

How do I give coding agents build logs and deploy feedback they can act on?

Expose structured deployment results through an API or MCP server instead of a red check. The Qovery MCP Server returns, per service, the state, the failing step, the error message and the duration of a deployment, and filters logs by deployment. Keep it read-only for this loop, since reading is all the agent needs to fix its code.

How do I stop an AI agent from deploying to production?

Give it a credential that cannot. A Qovery API Policy Token evaluates every API call against a Rego policy that denies by default, so you can allow deploys on [PR] environments only. Keep the MCP Server in its default read-only mode and leave promotion to production in your human merge and release rules.

Do preview environments for agent PRs get deleted automatically?

On Qovery, yes: a preview environment is deleted when its pull request is merged or closed. Add a deployment rule on the [PR]* pattern to stop previews at night, and turn on Create on demand so previews exist only for pull requests someone comments /qovery preview on.

Romaric Philogene
About the author
Romaric Philogene

Romaric founded Qovery to make Kubernetes accessible to every engineering team. He writes about platform strategy, developer experience, and the future of cloud infrastructure.

Next step

Give every agent PR a live environment in your own cloud.

Qovery builds each pull request, deploys it to its own preview environment on Kubernetes in your AWS, GCP, Azure or Scaleway account or your existing cluster, and hands your agent the build logs. Free plan, unlimited AI agents, no credit card.