Changed Deploy.yml
This commit is contained in:
@@ -7,11 +7,14 @@ on:
|
||||
stack_name:
|
||||
description: 'Stack to deploy'
|
||||
required: true
|
||||
default: 'ai-backend'
|
||||
# Default can be anything, or leave empty
|
||||
default: 'ai-backend'
|
||||
type: choice
|
||||
options:
|
||||
# Just list the filenames (without .nomad)
|
||||
- ai-backend
|
||||
- ai-frontend
|
||||
# - uptime-kuma (Add this later)
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
@@ -29,13 +32,20 @@ jobs:
|
||||
env:
|
||||
NOMAD_ADDR: "http://192.168.1.133:4646"
|
||||
run: |
|
||||
echo "Deploying ${{ inputs.stack_name }}..."
|
||||
|
||||
# --- AI STACK ---
|
||||
if [ "${{ inputs.stack_name }}" == "ai-backend" ]; then
|
||||
nomad job run stacks/ai/ai-backend.nomad
|
||||
STACK="${{ inputs.stack_name }}"
|
||||
echo "Searching for $STACK.nomad..."
|
||||
|
||||
# 1. Find the file anywhere inside the 'stacks' folder
|
||||
# This command looks in subfolders (ai, monitoring, etc) automatically
|
||||
FILE_PATH=$(find stacks -name "$STACK.nomad" -print -quit)
|
||||
|
||||
if [ -z "$FILE_PATH" ]; then
|
||||
echo "❌ Error: Could not find '$STACK.nomad' inside the 'stacks/' directory!"
|
||||
echo "Double check that the menu option matches the filename exactly."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${{ inputs.stack_name }}" == "ai-frontend" ]; then
|
||||
nomad job run stacks/ai/ai-frontend.nomad
|
||||
fi
|
||||
|
||||
# 2. Deploy it
|
||||
echo "✅ Found file at: $FILE_PATH"
|
||||
echo "🚀 Sending to Nomad..."
|
||||
nomad job run "$FILE_PATH"
|
||||
Reference in New Issue
Block a user