Publish via GitHub Actions

Automate blueprint publishing using GitHub Actions and the official Bricks Action for seamless CI/CD integration.

Prerequisites

  • GitHub repository with blueprint code

  • Bricks API key stored in GitHub Secrets

  • GitHub Actions enabled for the repository

  • Understanding of GitHub Actions workflows

Bricks Action Overview

The Bricks Actionarrow-up-right provides seamless integration between GitHub Actions and Bricks CLI commands.

Key Features

  • Version bumping: Automatic version management for artifacts and blueprints

  • Blueprint updates: Update and publish blueprints automatically

  • Deployment integration: Deploy infrastructure as part of the workflow

  • Git operations: Automatic commits and pushes for version updates

Basic Publishing Workflow

Simple Blueprint Publishing

Create .github/workflows/publish.yml:

Advanced Publishing Workflows

Multi-Environment Publishing

Conditional Publishing with Matrix

Workflow Features

Automatic Version Management

The updateci command automatically:

  • Detects changes in artifacts and blueprints

  • Bumps versions based on change type (patch, minor, major)

  • Updates dependencies between artifacts and blueprints

  • Commits changes back to the repository

  • Creates pull requests for review (optional)

Dry Run Mode

For pull requests, enable dry-run mode:

This shows what changes would be made without actually publishing.

Output Handling

Access workflow outputs for further processing:

Configuration Options

Version Bump Strategies

Output Formats

Custom Flags

Repository Structure

Organize your repository for optimal workflow performance:

GitHub Secrets Setup

Required Secrets

  1. BRICKS_API_KEY: Your Bluebricks API key

  2. GITHUB_TOKEN: Automatically provided by GitHub

Setting Up Secrets

  1. Go to your GitHub repository

  2. Navigate to Settings > Secrets and variables > Actions

  3. Click "New repository secret"

  4. Add your Bluebricks API key as BRICKS_API_KEY

Organization Secrets

For multiple repositories, use organization secrets:

  1. Go to your GitHub organization

  2. Navigate to Settings > Secrets and variables > Actions

  3. Add organization-level secrets

  4. Configure repository access

Advanced Patterns

Scheduled Publishing

Approval Gates

Monitoring and Notifications

Slack Notifications

Email Notifications

Best Practices

Workflow Design

  • Use path filters to trigger only on relevant changes

  • Implement proper error handling and rollback procedures

  • Use environment-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

See also

Last updated

Was this helpful?