mirror of https://github.com/buster-so/buster.git
Update action.yml
This commit is contained in:
parent
fab51e5600
commit
a9fe290551
|
@ -6,28 +6,16 @@ branding:
|
||||||
color: 'green'
|
color: 'green'
|
||||||
|
|
||||||
inputs:
|
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:
|
directory:
|
||||||
description: 'Directory containing buster.yml and models to deploy'
|
description: 'Directory containing buster.yml and models to deploy'
|
||||||
required: false
|
required: false
|
||||||
default: '.'
|
default: '.'
|
||||||
environment:
|
environment:
|
||||||
description: 'Target environment (e.g., production, staging)'
|
description: 'Target environment for deployment (e.g., production, staging)'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
force:
|
|
||||||
description: 'Force deployment (adds --force)'
|
|
||||||
required: false
|
|
||||||
default: 'true'
|
|
||||||
verbose:
|
verbose:
|
||||||
description: 'Verbose output (adds --verbose)'
|
description: 'Enable verbose output'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
|
||||||
|
@ -38,38 +26,23 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if ! command -v buster &>/dev/null && ! command -v buster.exe &>/dev/null; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set credentials/env
|
- name: Deploy to Buster
|
||||||
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
|
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ inputs.directory }}
|
working-directory: ${{ inputs.directory }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
if [[ -z "$BUSTER_API_KEY" ]]; then
|
||||||
|
echo "❌ Missing BUSTER_API_KEY env var"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
CMD="buster deploy"
|
CMD="buster deploy"
|
||||||
[[ -n "${{ inputs.environment }}" ]] && CMD="$CMD --environment ${{ inputs.environment }}"
|
[[ -n "${{ inputs.environment }}" ]] && CMD="$CMD --environment ${{ inputs.environment }}"
|
||||||
[[ "${{ inputs.force }}" == "true" ]] && CMD="$CMD --force"
|
|
||||||
[[ "${{ inputs.verbose }}" == "true" ]] && CMD="$CMD --verbose"
|
[[ "${{ inputs.verbose }}" == "true" ]] && CMD="$CMD --verbose"
|
||||||
|
|
||||||
echo "Running: $CMD"
|
echo "Running: $CMD"
|
||||||
$CMD
|
$CMD
|
||||||
|
|
Loading…
Reference in New Issue