This command is the recommended way to deploy applications in CI/CD pipelines and for version-controlled infrastructure.
porter apply is the primary command for deploying applications using configuration-as-code. It reads a porter.yaml file, builds a new container image, and deploys your application to the cluster.
By default, porter apply performs a full build and deploy cycle. Use --no-build to skip building and deploy with an existing image.
You can run
porter apply without a porter.yaml file to deploy using the existing application configuration. This is useful for triggering a new build and deploy without changing any settings.Usage
Prerequisites
- You’ve logged in to the Porter CLI after running porter auth login
- You’re connected to the correct project by running porter config set-project
- You’re connected to the correct cluster by running porter config set-cluster
Options
Deployment Options
Build Options
Environment Options
You can pass environment variables and secrets directly via command-line flags without modifying yourporter.yaml.
Validation Options
When you pass
--validate (or run porter apply validate), Porter validates the file based on its format:
- Single-app
porter.yaml— validated as one application configuration. - Multi-app/addon
porter.yaml(top-levelapps:and/oraddons:arrays) — each app and addon block is split out and validated individually. The command fails on the first invalid app or addon and reports its index in the array. - Legacy addon schemas — addon blocks that use the deprecated legacy schema are skipped with a yellow
DEPRECATION WARNING. Validation still succeeds for the rest of the file, but support for the legacy schema will be removed in a future release. Update the addon to the current schema to keep it covered by validation.
Advanced Options
Environment Variables
You can also configureporter apply using environment variables. These are automatically set in the GitHub workflow that Porter generates for your application.
Examples
Workflow
When you runporter apply, the following steps occur:
1
Parse Configuration
Porter reads and validates your
porter.yaml file (if provided)2
Build Image
Porter builds and pushes a new container image (unless
--no-build is specified)3
Deploy Services
Porter deploys or updates all services defined in the configuration
4
Wait for Rollout (if --wait)
If
--wait is specified, Porter waits for all services to become healthyConfiguration File
Theporter apply command expects a porter.yaml file. For detailed documentation on all available configuration options, see the porter.yaml Reference.
Minimal Example
CI/CD Integration
Most users deploy withporter apply through GitHub Actions. Porter automatically generates a GitHub workflow for your application that handles authentication and deployment.
The workflow below is similar to what Porter automatically creates when you connect your GitHub repository. You can find it in your repository at
.github/workflows/porter_<app-name>.yml.GitHub Actions Workflow
Related Commands
- porter app update - Update an app without building
- porter app yaml - Export the current app configuration as YAML

