GitOps Environments
Automatically trigger infrastructure plans and deployments from Git pushes
Overview
The basic promise of infrastructure as code is simple: when you change your code, your infrastructure should respond. Bluebricks lets you connect an environment directly to a Git repository so that every push triggers a run and every pull request gets a plan.
No CI/CD pipeline to build or maintain, and no need to manually create or version artifacts or blueprints; Bluebricks handles all of that from your source code.


How it works
When you create an automated environment, Bluebricks registers a webhook on your GitHub repository through the GitHub App. From that point, the flow is automatic: you push code (or open a PR), Bluebricks publishes an updated blueprint from the source, triggers a run, and posts the plan results back to the PR as a check run.
Push to the trigger branch: Bluebricks runs a full plan and apply
Pull request targeting the trigger branch: Bluebricks runs a plan only (changes are never applied from a PR)


Auto-trigger rules
Every automated environment has a trigger branch, the branch you select when creating the environment (e.g., main). Auto-trigger behavior depends on the type of Git event.
Push events
When code is pushed to the trigger branch, Bluebricks triggers a full install run (plan followed by apply). This is the default behavior for automated environments.
Pushes to other branches are ignored. Only the configured trigger branch activates the pipeline.
Pull request events
When a pull request is opened, updated (new commits pushed), or reopened against the trigger branch, Bluebricks triggers a plan-only run. This is a safety guard: pull request events never trigger an apply, regardless of configuration.
The plan output is posted back to the PR as a GitHub Check Run so reviewers can evaluate the infrastructure impact before approving the merge.
When a pull request is closed (merged or abandoned), Bluebricks cancels any pending check runs associated with that PR.
Blueprint publish events
If a new version of the linked blueprint is published through other means (e.g., the CLI or API), Bluebricks also triggers an auto-run on any environment with auto-trigger enabled for that blueprint. This ensures environments stay in sync even when blueprints are updated outside the Git flow.
Plan results on pull requests
When a pull request targets the trigger branch of an automated environment, Bluebricks creates a GitHub Check Run named Bluebricks Run: <environment-slug>. The check run progresses through several states:
Queued
The environment is waiting for a previous run to finish
In progress
Bluebricks is analyzing the repository or executing the plan
Completed (success)
The plan succeeded. The check run output contains the full plan details
Completed (failure)
The plan failed. The check run output contains error details
Cancelled
The PR was closed or the run was superseded by a newer push
The plan output (resource changes, additions, and deletions) appears directly in the check run's output tab on GitHub. Reviewers can read the infrastructure plan without leaving the pull request.
If an environment already has a running deployment when a new PR event arrives, the new run is queued and starts automatically once the current run completes.
How to set up an automated environment
To create an automated environment, use the From code flow in the Create environment modal. For step-by-step instructions, see Creating Environments > Connect source.
Bluebricks generates a blueprint from your source code, creates the environment, and triggers the first run. You must approve and apply this initial run to activate auto-trigger. Once the first run completes, the webhook is registered and every subsequent push to the configured branch and every PR targeting it automatically triggers runs.
Auto-trigger requires the GitHub integration (GitHub App). Public repositories created without the GitHub App do not support auto-trigger or check runs.
Limitations
Single trigger branch: each environment is linked to one branch. Pushes to other branches do not trigger runs
Cannot link existing environments: you can only create a new automated environment through the "From code" flow. Connecting an existing environment to a Git repository via the UI is planned for a future release
Last updated
Was this helpful?

