Update action.yml

This commit is contained in:
dal 2025-09-26 12:33:23 -06:00 committed by GitHub
parent fab51e5600
commit a9fe290551
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 37 deletions

View File

@ -6,28 +6,16 @@ branding:
color: 'green'
inputs:
api-key:
description: 'Buster API key (falls back to BUSTER_API_KEY)'
required: false
default: ''
host:
description: 'Buster API host URL (falls back to BUSTER_HOST or https://api.buster.so)'
required: false
default: ''
directory:
description: 'Directory containing buster.yml and models to deploy'
required: false
default: '.'
environment:
description: 'Target environment (e.g., production, staging)'
description: 'Target environment for deployment (e.g., production, staging)'
required: false
default: ''
force:
description: 'Force deployment (adds --force)'
required: false
default: 'true'
verbose:
description: 'Verbose output (adds --verbose)'
description: 'Enable verbose output'
required: false
default: 'false'
@ -38,38 +26,23 @@ runs:
shell: bash
run: |
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)."
echo "❌ Buster CLI not found. Please install with buster-so/buster-actions/install first."
exit 1
fi
- name: Set credentials/env
shell: bash
run: |
set -e
API_KEY="${{ inputs.api-key }}"
if [[ -z "$API_KEY" ]]; then
API_KEY="${BUSTER_API_KEY:-}"
fi
if [[ -z "$API_KEY" ]]; then
echo "No API key provided. Set input 'api-key' or env BUSTER_API_KEY."
exit 1
fi
echo "BUSTER_API_KEY=$API_KEY" >> "$GITHUB_ENV"
HOST="${{ inputs.host }}"
if [[ -z "$HOST" ]]; then
HOST="${BUSTER_HOST:-https://api.buster.so}"
fi
echo "BUSTER_HOST=$HOST" >> "$GITHUB_ENV"
- name: Deploy
- name: Deploy to Buster
shell: bash
working-directory: ${{ inputs.directory }}
run: |
set -e
if [[ -z "$BUSTER_API_KEY" ]]; then
echo "❌ Missing BUSTER_API_KEY env var"
exit 1
fi
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