mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-13 19:46:16 +03:00
5caf1f9f6f
Takes the v2 tree, with packages/console, packages/web, packages/stats, packages/function, infra and sst.config.ts merged up to latest dev, and retargets V2 publishing and deploys from the v2 branch to dev.
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import { domain } from "./stage"
|
|
|
|
const GITHUB_APP_ID = new sst.Secret("GITHUB_APP_ID")
|
|
const GITHUB_APP_PRIVATE_KEY = new sst.Secret("GITHUB_APP_PRIVATE_KEY")
|
|
export const EMAILOCTOPUS_API_KEY = new sst.Secret("EMAILOCTOPUS_API_KEY")
|
|
const ADMIN_SECRET = new sst.Secret("ADMIN_SECRET")
|
|
const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN")
|
|
const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID")
|
|
const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID")
|
|
const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET")
|
|
const bucket = new sst.cloudflare.Bucket("Bucket")
|
|
|
|
export const api = new sst.cloudflare.Worker("Api", {
|
|
domain: `api.${domain}`,
|
|
handler: "packages/function/src/api.ts",
|
|
environment: {
|
|
WEB_DOMAIN: domain,
|
|
},
|
|
url: true,
|
|
link: [
|
|
bucket,
|
|
GITHUB_APP_ID,
|
|
GITHUB_APP_PRIVATE_KEY,
|
|
ADMIN_SECRET,
|
|
DISCORD_SUPPORT_BOT_TOKEN,
|
|
DISCORD_SUPPORT_CHANNEL_ID,
|
|
FEISHU_APP_ID,
|
|
FEISHU_APP_SECRET,
|
|
],
|
|
transform: {
|
|
worker: (args) => {
|
|
args.logpush = true
|
|
if ($app.stage === "vimtor" || $app.stage === "adam") return
|
|
args.bindings = $resolve(args.bindings).apply((bindings) => [
|
|
...bindings,
|
|
{
|
|
name: "SYNC_SERVER",
|
|
type: "durable_object_namespace",
|
|
className: "SyncServer",
|
|
},
|
|
])
|
|
args.migrations = {
|
|
// Note: when releasing the next tag, make sure all stages use tag v2
|
|
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
|
|
newTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
|
|
//newSqliteClasses: ["SyncServer"],
|
|
}
|
|
},
|
|
},
|
|
})
|
|
|
|
new sst.cloudflare.x.Astro("Web", {
|
|
domain: "docs." + domain,
|
|
path: "packages/web",
|
|
environment: {
|
|
// For astro config
|
|
SST_STAGE: $app.stage,
|
|
VITE_API_URL: api.url.apply((url) => url!),
|
|
},
|
|
})
|