-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·36 lines (28 loc) · 1.06 KB
/
deploy.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.06 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
#!/bin/bash
# AI 短视频脚本生成器 - 部署脚本
set -e
echo "🚀 开始部署 AI 短视频脚本生成器..."
# 设置 Cloudflare API Token
export CLOUDFLARE_API_TOKEN="L9j0jM6Qv8knfqjQrD2gTgE3rhbkVm7MSSoCiofO"
# 检查是否需要设置 API Key
if [ -z "$RIGHT_CODES_API_KEY" ]; then
echo "⚠️ 警告: RIGHT_CODES_API_KEY 环境变量未设置"
echo "📝 请输入你的 right.codes API Key:"
read -s API_KEY
export RIGHT_CODES_API_KEY="$API_KEY"
fi
# 使用 wrangler 部署(通过 API Token 认证)
echo "📦 正在部署到 Cloudflare Workers..."
wrangler deploy \
--api-token "$CLOUDFLARE_API_TOKEN" \
--compatibility-date 2024-01-01
echo ""
echo "✅ 部署完成!"
echo ""
echo "📌 下一步:"
echo "1. 访问 Cloudflare Dashboard 查看部署的 Worker"
echo "2. 配置 RIGHT_CODES_API_KEY 密钥(通过 wrangler secret put)"
echo "3. 获取 Worker URL 并访问"
echo ""
echo "💡 提示:你可以使用以下命令设置密钥:"
echo " wrangler secret put RIGHT_CODES_API_KEY --api-token $CLOUDFLARE_API_TOKEN"