Deploy applications using porter.yaml with the porter apply command, supporting container builds, image updates, and preview environments
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.
Path to the porter.yaml configuration file (optional if app already exists)
--app
Override the app name specified in porter.yaml
--target
-x
Specify a deployment target (name or ID)
--wait
-w
Wait for the deployment to complete before exiting. For multi-app porter.yaml files that include datastore addons, also waits up to 10 minutes for each addon to reach the AVAILABLE state before apps are deployed
--preview
-p
Deploy to a preview environment based on current git branch
Use --exact with caution. When set, this flag disables config merging with existing app configuration—any settings not explicitly defined in your porter.yaml will be overwritten. Most users should avoid this flag unless they need to completely replace the application configuration.
Flag
Description
--exact
Disable config merging with existing app configuration
You can also configure porter apply using environment variables. These are automatically set in the GitHub workflow that Porter generates for your application.
When you run porter 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 healthy. When the porter.yaml defines datastore addons, Porter also waits for each addon to reach the AVAILABLE state before deploying the apps that depend on it.
Most users deploy with porter 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.