2025-09-05 01:21:47 +08:00
|
|
|
name: 'Buster Deploy'
|
|
|
|
description: 'Deploy semantic models to Buster using the CLI'
|
|
|
|
author: 'Buster'
|
|
|
|
branding:
|
|
|
|
icon: 'upload-cloud'
|
|
|
|
color: 'green'
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
api-key:
|
2025-09-27 02:31:02 +08:00
|
|
|
description: 'Buster API key (falls back to BUSTER_API_KEY)'
|
2025-09-05 01:21:47 +08:00
|
|
|
required: false
|
|
|
|
default: ''
|
|
|
|
host:
|
2025-09-27 02:31:02 +08:00
|
|
|
description: 'Buster API host URL (falls back to BUSTER_HOST or https://api.buster.so)'
|
2025-09-05 01:21:47 +08:00
|
|
|
required: false
|
|
|
|
default: ''
|
|
|
|
directory:
|
|
|
|
description: 'Directory containing buster.yml and models to deploy'
|
|
|
|
required: false
|
|
|
|
default: '.'
|
|
|
|
environment:
|
2025-09-27 02:31:02 +08:00
|
|
|
description: 'Target environment (e.g., production, staging)'
|
2025-09-05 01:21:47 +08:00
|
|
|
required: false
|
|
|
|
default: ''
|
|
|
|
force:
|
2025-09-27 02:31:02 +08:00
|
|
|
description: 'Force deployment (adds --force)'
|
2025-09-05 01:21:47 +08:00
|
|
|
required: false
|
|
|
|
default: 'true'
|
|
|
|
verbose:
|
2025-09-27 02:31:02 +08:00
|
|
|
description: 'Verbose output (adds --verbose)'
|
2025-09-05 01:21:47 +08:00
|
|
|
required: false
|
|
|
|
default: 'false'
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: 'composite'
|
|
|
|
steps:
|
2025-09-27 02:31:02 +08:00
|
|
|
- name: Require Buster CLI
|
2025-09-05 01:21:47 +08:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2025-09-27 02:31:02 +08:00
|
|
|
if ! command -v buster &>/dev/null && ! command -v buster.exe &>/dev/null; then
|
|
|
|
echo "Buster CLI not found. Add a step to install it (e.g., buster-so/buster-actions/install)."
|
2025-09-05 01:21:47 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
2025-09-27 02:31:02 +08:00
|
|
|
|
|
|
|
- name: Set credentials/env
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
2025-09-05 01:21:47 +08:00
|
|
|
API_KEY="${{ inputs.api-key }}"
|
|
|
|
if [[ -z "$API_KEY" ]]; then
|
|
|
|
API_KEY="${BUSTER_API_KEY:-}"
|
|
|
|
fi
|
|
|
|
if [[ -z "$API_KEY" ]]; then
|
2025-09-27 02:31:02 +08:00
|
|
|
echo "No API key provided. Set input 'api-key' or env BUSTER_API_KEY."
|
2025-09-05 01:21:47 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
2025-09-27 02:31:02 +08:00
|
|
|
echo "BUSTER_API_KEY=$API_KEY" >> "$GITHUB_ENV"
|
|
|
|
|
2025-09-05 01:21:47 +08:00
|
|
|
HOST="${{ inputs.host }}"
|
|
|
|
if [[ -z "$HOST" ]]; then
|
|
|
|
HOST="${BUSTER_HOST:-https://api.buster.so}"
|
|
|
|
fi
|
2025-09-27 02:31:02 +08:00
|
|
|
echo "BUSTER_HOST=$HOST" >> "$GITHUB_ENV"
|
2025-09-05 01:21:47 +08:00
|
|
|
|
2025-09-27 02:31:02 +08:00
|
|
|
- name: Deploy
|
2025-09-05 01:21:47 +08:00
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ inputs.directory }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2025-09-27 02:31:02 +08:00
|
|
|
CMD="buster deploy"
|
|
|
|
[[ -n "${{ inputs.environment }}" ]] && CMD="$CMD --environment ${{ inputs.environment }}"
|
|
|
|
[[ "${{ inputs.force }}" == "true" ]] && CMD="$CMD --force"
|
|
|
|
[[ "${{ inputs.verbose }}" == "true" ]] && CMD="$CMD --verbose"
|
|
|
|
echo "Running: $CMD"
|
|
|
|
$CMD
|