Skip to main content

Using BuildBeaver with GitHub Actions

Assuming you have BuildBeaver set up to build your repository using either Go or YAML then integrating with GitHub actions is as easy as adding the setup-bb GitHub Action into your GitHub workflows.

Try creating a YAML file for a GitHub Actions workflow in your repo, e.g. .github/workflows/bb-run.yml, and paste in the following content, editing the artifacts definitions to match your BuildBeaver build:

name: Build using BuildBeaver

on:
push:
workflow_dispatch:

jobs:
build-acme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Running BB CLI within your repository
- name: Build using BB CLI
uses: buildbeaver/setup-bb@main
with:
version: '1.0.0'
args: '-v'

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: report-artifacts
path: reports/test-report.txt
tip

Any environment variables available on the runner will be accessible by the BB CLI as it executes.


Usage

Run the BuildBeaver CLI within your repository

The following GitHub Actions workflow YAML will install the default version of BB CLI (see Inputs) into your Runner's path and execute bb run to build your repo:

name: BuildBeaver

on:
push:
workflow_dispatch:

jobs:
build-acme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Running BB CLI within your repository
- name: Build using BB CLI
uses: buildbeaver/setup-bb@main

Install the BuildBeaver CLI into your PATH without running

The following GitHub Actions workflow YAML will install the default version of BB CLI into your Runner's path but not run the tool. Any execution of bb is up to you to add later:

name: BuildBeaver

on:
push:
workflow_dispatch:

jobs:
build-acme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Installing BB CLI onto Runner's path
- name: Build using BB CLI
uses: buildbeaver/setup-bb@main
with:
install-only: true

Inputs

The following inputs can be used as step.with keys

NameTypeDefaultDescription
versionString1.0.0The version of the BuildBeaver CLI to install (e.g. from https://github.com/buildbeaver/bb-cli/releases )
install-onlyBooleanfalseSet to true install but not run the BuildBeaver CLI, accessible via the runner's PATH
argsString''Any additional args to pass to the run command