Build Pipelines

# Build, Compile, and Deploy  
All in One Step

Define custom build commands to run before, during, and after each deployment. Compile assets, install dependencies, and deploy — automatically.

[Start Free Trial](/signup?cta=Start+Free+Trial)

Isolated Docker builds

Any language or framework

Free plan available

Last updated on 22nd February 2026

Build Pipeline

npm install

✓ Done

npm run build

✓ Done

npm test

✓ Done

Deploy to server

⟳ Running

A build pipeline is a series of automated commands that run before your code is deployed. DeployHQ's build pipeline compiles assets, installs dependencies, runs tests, and prepares your project for production — all within isolated Docker containers on our infrastructure.

## The Problem with Deploying Raw Source Code

Modern projects require compilation, bundling, and dependency installation before they're ready for production.

RAW SOURCEsrc/app.tsxstyles/main.scsspackage.json⚠ Build Step?PRODUCTION❌ Uncompiled code❌ Missing assets❌ No dependenciesDeploying raw source code leads to broken production sites

Without a build step, your production server receives raw source code that browsers and servers can't use directly.

## Build Pipelines — The Solution

Run build commands in an isolated environment. Only production-ready files reach your server.

SOURCE CODEsrc/app.tsxstyles/main.scsspackage.jsonBUILD PIPELINEnpm installnpm run buildcomposer install⚡ Isolated EnvironmentPRODUCTION✓ dist/app.js✓ dist/style.css✓ vendor/✓ Ready!

## How It Works

Define your build commands and we handle the rest — securely and automatically.

1

 ![Text icon](/assets/icons/text-4e556c28179c8aa2c87cbad966a3805f4b07a7d82b1a71b129247d19c3c6d5e0.svg)

### Define Commands

Write the build commands to run before, during, or after deployment.

2

 ![Server icon](/assets/icons/server-3dea9382c13b5eb86283b34dac5391d37d7daab491d2ab3b3f48fb6c03df33de.svg)

### Isolated Build

Commands run securely in an isolated Docker environment with your chosen runtimes.

3

 ![Cloud icon](/assets/icons/cloud-d372ee912544376132418f98c0f50595f884b9c6432a2f78d8fe9017186d8e90.svg)

### Upload Results

Only the compiled, production-ready files are uploaded to your server.

4

 ![Check icon](/assets/icons/check-a44bf1dbe680e7b7d11c6ba4f27febd17fde07a1f0bab9f93608e0e1d9acee9b.svg)

### Run SSH Commands

Execute post-deploy SSH commands like cache clearing or service restarts.

## Why Use Build Pipelines?

Keep compiled files out of your repository and automate your entire build process.

 ![Zap icon](/assets/icons/zap-17eaa1be55c76d539c8ab6b4c667d86fc6478529af6fc62d282cf996beda3fe0.svg)

### Any Framework

Whether you use Webpack, Vite, Gulp, or any other build tool — define your commands and we'll run them. Supports Node, PHP, Ruby, Python, Go, Java, and .NET.

 ![Shield icon](/assets/icons/shield-check-a41a13fb7948321ec9c27cc6c623578153c9caa1fc75851bcd93afbe7dbe79f1.svg)

### Secure Isolation

Build commands run in an isolated Docker container. Your code is compiled in a clean, secure environment every time.

 ![Folder icon](/assets/icons/folder-5a1d3bb6e916338b24a45559a43b4bcb9317612584e508032c4648d970e77511.svg)

### Clean Repository

No need to commit compiled files to your repository. Build artifacts are generated fresh on every deployment.

 ![Check icon](/assets/icons/check-a44bf1dbe680e7b7d11c6ba4f27febd17fde07a1f0bab9f93608e0e1d9acee9b.svg)

### SSH Commands

Execute commands on your server before and after deployment. Clear caches, restart services, or run migrations automatically.

## Environment Variables — Inject Config Without Touching Code

Define variables once and use them across build commands, custom actions, and SSH steps. Project-wide or per-server.

 ![Folder icon](/assets/icons/folder-5a1d3bb6e916338b24a45559a43b4bcb9317612584e508032c4648d970e77511.svg)

### Project and Server Scopes

Set shared values at the project level, then override per server for staging, production, or per-region credentials. No code duplication.

 ![Shield icon](/assets/icons/shield-check-a41a13fb7948321ec9c27cc6c623578153c9caa1fc75851bcd93afbe7dbe79f1.svg)

### Sensitive Values Masked

Mark a variable as sensitive and DeployHQ masks it in build logs, SSH output, and deploy notifications. No accidental secret leakage.

 ![Check icon](/assets/icons/check-a44bf1dbe680e7b7d11c6ba4f27febd17fde07a1f0bab9f93608e0e1d9acee9b.svg)

### Available Everywhere

Variables flow into build commands, custom actions, and pre/post-deploy SSH hooks — the same value, the same name, every step of the deploy.

Getting Started

## Set up build pipelines in minutes

 ![Check mark](/assets/icons/tick-01ba7f4740d492a18fbdf4424bf7446c87ddfccbc0157214ad536b11512e914d.svg)

### Add Build Commands

Define your build commands in the project settings (e.g. npm install, npm run build).

 ![Check mark](/assets/icons/tick-01ba7f4740d492a18fbdf4424bf7446c87ddfccbc0157214ad536b11512e914d.svg)

### Choose Your Runtime

Select the language versions you need — Node, PHP, Ruby, Python, and more.

 ![Check mark](/assets/icons/tick-01ba7f4740d492a18fbdf4424bf7446c87ddfccbc0157214ad536b11512e914d.svg)

### Deploy Automatically

Every deployment now compiles, bundles, and uploads production-ready files.

[Read the documentation →](https://www.deployhq.com/support/build-pipelines)

BUILD CONFIGURATIONBuild Commands:$ npm install$ npm run buildRuntime:Node.js 20.x • PHP 8.3 • Ruby 3.3SSH After Deploy:$ php artisan cache:clear

## Frequently Asked Questions

### What languages and tools can I use in build pipelines?

DeployHQ's build servers support a wide range of languages and tools including Node.js, Ruby, Python, PHP, Go, and more. You can run any command that your project needs — npm install, composer install, bundle install, webpack, gulp, and similar.

### Are build commands run on my server?

No. Build commands run on DeployHQ's dedicated build servers, not on your production server. Only the compiled output is deployed to your server, keeping your production environment clean and secure.

### Can I cache dependencies between builds?

Yes. DeployHQ caches your build dependencies between deployments so subsequent builds are faster. Dependencies like node\_modules or vendor directories are preserved and only updated when your lock files change. See [Build Cache](/features/build-cache) for the full story.

### Can I set environment variables for build commands and SSH steps?

Yes. Define variables at the project level (shared everywhere) or per server (for staging vs production overrides). Sensitive values are masked in logs. The same variables are available to build commands, custom actions, and pre/post-deploy SSH hooks.

### Can I make a build command only run when specific files change?

Yes. Each build command supports Watch Files — comma-separated glob patterns like package\*.json or src/\*\*/\*.js. If none of the watched files changed since the last deployment, the command is skipped entirely. First deployments always run every command, and the same syntax works in the UI, .deploybuild.yaml, or via the API.

### Can I run AWS CLI, Terraform, or kubectl inside the pipeline?

Yes — through [Custom Actions](/features/custom-actions). A Custom Action runs any Docker image (AWS CLI, Terraform, kubectl, or your own) with your environment variables wired in, alongside the rest of the pipeline. Useful for invalidating a CDN, applying Terraform, or restarting a Kubernetes rollout as part of the deploy.

## Ready to automate your builds?

Compile, bundle, and deploy in one seamless workflow.

[Start Free Trial](/signup?cta=Start+Free+Trial)

10-day free trial • No setup fees • Cancel anytime

## Explore More Features

Discover all the tools that make DeployHQ the easiest way to deploy your code.

[

### Zero Downtime Deployments
→](/features/zero-downtime-deployments)[

### One-Click Rollback
→](/features/one-click-rollback)[

### Turbo Deployments
→](/features/turbo-deployments)[

### Build Pipelines
→](/features/build-pipelines)[

### Build Cache
→](/features/build-cache)[

### Scheduled Deployments
→](/features/scheduled-deployments)[

### Deployment Availability
→](/features/deployment-availability)[

### Docker Builds
→](/features/docker-builds)[

### Deployment Checks
→](/features/deployment-checks)[

### Deployment Targets
→](/features/deployment-targets)[

### Automatic Deployment
→](/features/automatic-deployments)[

### Deployment Templates
→](/features/deployment-templates)[

### Deploy Behind Firewalls
→](/features/deploy-behind-firewalls)[

### SSH Deployment
→](/features/ssh-deployment)[

### Deployment Zones
→](/features/deployment-zones)[

### Team & Permissions
→](/features/team-permissions)[

### Single Sign-On
→](/features/sso)[

### Custom Actions
→](/features/custom-actions)[

### Server Management
→](/features/server-management)[

### CLI & Agents
→](/agents)[

### Powerful Integrations
→](/features/integrations)

## Get started today for just $9/month

That's unlimited deployments and 3 projects.

[Start your free 10 day trial](/signup?cta=Start+your+free+10+day+trial)
