Github Actions
Overview
The Bluebricks GitHub Actions integration lets you run any Bricks CLI command directly from your GitHub workflows. Using the official bluebricks-co/bricks-action GitHub Action, you can:
Bump and publish artifact and blueprint versions
Detect and respond to changes in your IaC
Deploy infrastructure to Bluebricks collections
Automate approvals, promotions, and notifications as part of CI/CD
This keeps Bluebricks as the orchestration layer for your infrastructure, while GitHub remains the system of record for code and pipelines.
Core Capabilities
The Bricks GitHub Action provides:
Full Bricks CLI coverage – run any supported Bricks CLI command (
updateci,install,bprint, etc.)Automatic version management – detect changes and bump artifact/blueprint versions (patch, minor, major, or auto)
Blueprint publishing – update and publish blueprints directly from workflow runs
Deployment integration – trigger Bluebricks deployments as part of your pipeline
Git operations – commit, push, and create PRs for version changes
Dry-run support – simulate changes (e.g., on PRs) without publishing or deploying
How to create a workflow with Bricks CLI Github Action
Create a new workflow and choose to set up a workflow yourself

Search for Bluebricks

Choose Bricks CLI Action to access the listing

Create you workflow and commit changes
Basic Usage
Add the Bricks Action to your workflow:
The command input determines which Bricks CLI command runs (e.g., updateci, install).
Example: Update Artifacts and Blueprints on PR
Use updateci to detect changes and bump versions when a pull request is opened or approved:
This pattern is ideal for automatic versioning + review, using dry-run mode on PRs.
Example: Deploy Infrastructure with Install
Use the install command to generate plans and apply deployments from GitHub Actions:
Common pattern:
PRs →
plan-only: truefor review This will create an MD file of the plan and display it once a PR is submitted
Manual or branch pushes → full apply to a target collection
Publishing Blueprints with GitHub Actions
A typical blueprint publishing workflow triggers on changes to the bluebricks/** folder:
This automatically:
Detects changes
Bumps versions
Updates dependencies
Commits and pushes version changes back to the repo
Inputs (High-Level)
Global
command– (Required) Bricks CLI command to run (e.g.,updateci,install,bprint).
Common for updateci
updateciartifacts-folder– Path to artifacts source (e.g.,bluebricks/packages).blueprints-folder– Path to blueprints (e.g.,bluebricks/blueprints).artifact-bump/blueprint-bump– Version bump type (patch,minor,major,auto).output– Dependency graph format (asciiorjson).api-key– Bluebricks API key (from secrets).flags– Extra CLI flags (e.g.,--dry,--verbose).
Common for install
installfile– Path to deployment manifest YAML.env– Collection slug.plan-only– Whether to plan without applying.set-slug– Custom deployment slug (optional).api-key– Bluebricks API key.
Outputs
For the updateci command, the following outputs are available:
has_changes: Whether any versions were updated.changes_summary: Summary of version and dependency changes.dependency_graph: ASCII or JSON dependency graph.
For the install command, the following outputs are available:
deployment_plan: Detailed deployment plan with resources to change.plan_id: Unique identifier for the generated plan.
you can consume outputs in later steps, for example:
Example:
Prerequisites & Secrets
BRICKS_API_KEY
A valid Bluebricks API key stored as a GitHub Actions secret (e.g.,
BRICKS_API_KEY).
GITHUB_TOKEN
The built-in
GITHUB_TOKENis used for commits, pushes, and PR interaction.
Organization Secrets
For multiple repositories, use organization secrets:
Go to your GitHub organization
Navigate to Settings > Secrets and variables > Actions
Add organization-level secrets
Configure repository access
Permissions If you specify workflow permissions you must add these:
contents: writepull-requests: writeRepository structure
Recommended folders:
bluebricks/packages– artifact sourcebluebricks/blueprints– blueprint definitionsdeployments/– deployment manifest files
For multi-repo setups, consider using Organization Secrets to share the same BRICKS_API_KEY across repositories.
Advanced Patterns
You can combine the Bricks Action with standard GitHub Actions features to build richer workflows:
Multi-collection pipelines – Decide collection based on branch (
main → production,develop → staging).Matrix publishing – Publish to multiple collections or strategies in parallel.
Scheduled publishing – Use
schedule:to publish on a weekly or nightly cadence.Approval gates – Use GitHub Collections with required approvals for production publishing.
Notifications – Add Slack or email steps that consume
has_changesor job status to notify teams on success/failure.
Example: Multi-Collection Publishing
Example: Conditional Publishing with Matrix
Customization & Precedence
Bricks CLI configuration follows this precedence:
GitHub Action inputs
Collection variables
Bricks config file (e.g.,
config.yaml)Internal defaults
This gives you flexibility to:
Keep most configuration in code
Override behavior per workflow or job with inputs and flags
Reuse a shared configuration file where it makes sense
Best Practices
Workflow Design
Use path filters to trigger only on relevant changes
Implement proper error handling and rollback procedures
Use collection-specific configurations
Add status checks for pull requests
Security
Store API keys in GitHub Secrets
Use least-privilege permissions
Review workflow changes carefully
Monitor workflow execution logs
Performance
Use matrix strategies for parallel execution
Cache dependencies when possible
Optimize workflow triggers
Monitor workflow execution time
Last updated
Was this helpful?

