-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-supabase-functions.sh
More file actions
executable file
Β·43 lines (36 loc) Β· 1.41 KB
/
Copy pathdeploy-supabase-functions.sh
File metadata and controls
executable file
Β·43 lines (36 loc) Β· 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Deploy Supabase Edge Functions for Newsletter Automation
# Make sure you have Supabase CLI installed: npm install -g supabase
echo "π Deploying Supabase Edge Functions..."
# Check if Supabase CLI is installed
if ! command -v supabase &> /dev/null; then
echo "β Supabase CLI not found. Installing..."
npm install -g supabase
fi
# Login to Supabase (if not already logged in)
echo "π Checking Supabase authentication..."
supabase status 2>/dev/null || {
echo "Please login to Supabase:"
supabase login
}
# Deploy the newsletter function
echo "π§ Deploying send-newsletter function..."
supabase functions deploy send-newsletter
# Set environment variables for the function
echo "βοΈ Setting environment variables..."
echo "Please set these environment variables in your Supabase dashboard:"
echo "1. Go to your Supabase project dashboard"
echo "2. Navigate to Edge Functions > send-newsletter"
echo "3. Add these environment variables:"
echo " - NEWSLETTER_API_KEY: your_newsletter_api_key"
echo " - SITE_URL: https://voidd.space"
echo ""
echo "β
Deployment complete!"
echo ""
echo "π Next steps:"
echo "1. Set the environment variables in Supabase dashboard"
echo "2. Run the SQL trigger in your Supabase SQL editor"
echo "3. Test by publishing a post in your database"
echo ""
echo "π Your function URL:"
echo "https://your-project-ref.supabase.co/functions/v1/send-newsletter"