From 2b5d5d9df2c16d1ec92b700a54a44ce8cc95f437 Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Sat, 27 Dec 2025 12:35:58 -0500 Subject: [PATCH] Changed Deploy.yml --- .gitea/workflows/deploy.yaml | 30 ++++++++++++++++++++---------- stacks/ai/ai-backend.hcl | 0 stacks/ai/ai-frontend.hcl | 0 3 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 stacks/ai/ai-backend.hcl create mode 100644 stacks/ai/ai-frontend.hcl diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index c0f8d8f..0b3aa82 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -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 \ No newline at end of file + + # 2. Deploy it + echo "✅ Found file at: $FILE_PATH" + echo "🚀 Sending to Nomad..." + nomad job run "$FILE_PATH" \ No newline at end of file diff --git a/stacks/ai/ai-backend.hcl b/stacks/ai/ai-backend.hcl new file mode 100644 index 0000000..e69de29 diff --git a/stacks/ai/ai-frontend.hcl b/stacks/ai/ai-frontend.hcl new file mode 100644 index 0000000..e69de29