Skip to content

Commit 9cabebf

Browse files
committed
ci: update cloudflare one-click deploy environment variable handling and configuration
1 parent 47aea53 commit 9cabebf

File tree

8 files changed

+10
-8
lines changed

8 files changed

+10
-8
lines changed

.env.example renamed to .env.node.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Environment Variables for Node.js Runtime
2+
13
# Sqlite3 Database URL
24
DATABASE_URL="file:./db.sqlite"
35

.github/workflows/scripts/deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config = {
1515
name: "typix-preview",
1616
vars: {
1717
MODE: "client",
18-
PROVIDER_CLOUDFLARE_BUILTIN: true,
18+
PROVIDER_CLOUDFLARE_BUILTIN: "true",
1919
},
2020
},
2121
},
@@ -24,7 +24,7 @@ const config = {
2424
override: {
2525
vars: {
2626
MODE: "mixed",
27-
PROVIDER_CLOUDFLARE_BUILTIN: false,
27+
PROVIDER_CLOUDFLARE_BUILTIN: "false",
2828
},
2929
},
3030
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pnpm install
119119
2. **Configure environment variables**
120120

121121
```bash
122-
cp .env.example .env
122+
cp .env.node.example .env
123123
# Edit .env file to configure necessary parameters
124124
```
125125

README_zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pnpm install
119119
2. **配置环境变量**
120120

121121
```bash
122-
cp .env.example .env
122+
cp .env.node.example .env
123123
# 编辑 .env 文件配置必要参数
124124
```
125125

src/app/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function RootComponent() {
135135
if (db) {
136136
initContext({
137137
db: db,
138-
PROVIDER_CLOUDFLARE_BUILTIN: import.meta.env.PROVIDER_CLOUDFLARE_BUILTIN === true,
138+
PROVIDER_CLOUDFLARE_BUILTIN: import.meta.env.PROVIDER_CLOUDFLARE_BUILTIN === "true",
139139
});
140140
await initSettings();
141141
isMobileCleanup = initIsMobile();

src/server/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const factory = createFactory<Env>({
2020
initContext({
2121
db,
2222
AI: c.env.AI,
23-
PROVIDER_CLOUDFLARE_BUILTIN: c.env.PROVIDER_CLOUDFLARE_BUILTIN || false,
23+
PROVIDER_CLOUDFLARE_BUILTIN: c.env.PROVIDER_CLOUDFLARE_BUILTIN === "true" || false,
2424
});
2525
await next();
2626
});

src/server/api/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type Env = {
1010
Bindings: {
1111
DB: D1Database;
1212
AI: Ai;
13-
PROVIDER_CLOUDFLARE_BUILTIN?: boolean;
13+
PROVIDER_CLOUDFLARE_BUILTIN?: "true" | "false";
1414
};
1515
Variables: {
1616
db: DrizzleDb;

wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ MODE = "mixed"
2626

2727
# Enable Cloudflare built-in AI binding
2828
# When set to true, uses Cloudflare Workers AI for image generation without requiring additional API keys
29-
PROVIDER_CLOUDFLARE_BUILTIN = true
29+
PROVIDER_CLOUDFLARE_BUILTIN = "true"

0 commit comments

Comments
 (0)