#!/bin/bash

# Deploy to Render.com using render-cli
# Make sure you have render-cli installed: npm install -g @render/cli

echo "🚀 Deploying RealtimeCursor API to Render.com..."

# Login to Render (you'll need to have already authenticated with render-cli)
echo "🔑 Checking Render authentication..."
render whoami || (echo "❌ Not logged in to Render. Please run 'render login' first." && exit 1)

# Deploy using render.yaml
echo "📤 Deploying using render.yaml..."
render blueprint apply

echo "✅ Deployment initiated!"
echo "🌐 Your API will be available at: https://realtimecursor-api.onrender.com"
echo "⏳ It may take a few minutes for the deployment to complete."