Changed Deploy.yml
This commit is contained in:
@@ -7,11 +7,14 @@ on:
|
|||||||
stack_name:
|
stack_name:
|
||||||
description: 'Stack to deploy'
|
description: 'Stack to deploy'
|
||||||
required: true
|
required: true
|
||||||
default: 'ai-backend'
|
# Default can be anything, or leave empty
|
||||||
|
default: 'ai-backend'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
|
# Just list the filenames (without .nomad)
|
||||||
- ai-backend
|
- ai-backend
|
||||||
- ai-frontend
|
- ai-frontend
|
||||||
|
# - uptime-kuma (Add this later)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -29,13 +32,20 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NOMAD_ADDR: "http://192.168.1.133:4646"
|
NOMAD_ADDR: "http://192.168.1.133:4646"
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying ${{ inputs.stack_name }}..."
|
STACK="${{ inputs.stack_name }}"
|
||||||
|
echo "Searching for $STACK.nomad..."
|
||||||
# --- AI STACK ---
|
|
||||||
if [ "${{ inputs.stack_name }}" == "ai-backend" ]; then
|
# 1. Find the file anywhere inside the 'stacks' folder
|
||||||
nomad job run stacks/ai/ai-backend.nomad
|
# 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
|
fi
|
||||||
|
|
||||||
if [ "${{ inputs.stack_name }}" == "ai-frontend" ]; then
|
# 2. Deploy it
|
||||||
nomad job run stacks/ai/ai-frontend.nomad
|
echo "✅ Found file at: $FILE_PATH"
|
||||||
fi
|
echo "🚀 Sending to Nomad..."
|
||||||
|
nomad job run "$FILE_PATH"
|
||||||
0
stacks/ai/ai-backend.hcl
Normal file
0
stacks/ai/ai-backend.hcl
Normal file
0
stacks/ai/ai-frontend.hcl
Normal file
0
stacks/ai/ai-frontend.hcl
Normal file
Reference in New Issue
Block a user