Skip to content

Commit

Permalink
I think it's better to fail the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
balegas committed Jan 30, 2025
1 parent 6560ac9 commit 4d2beb6
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions examples/linearlite-read-only/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,39 @@ export default $config({
}
},
async run() {
const dbName =
`linearlite-read-only` + isProduction() ? `` : `-stage-${$app.stage}`
try {
const dbName =
`linearlite-read-only` + isProduction() ? `` : `-stage-${$app.stage}`

const { pooledDatabaseUri, sourceId, sourceSecret } =
createDatabaseForCloudElectric({
dbName,
migrationsDirectory: `./db/migrations`,
})
const { pooledDatabaseUri, sourceId, sourceSecret } =
createDatabaseForCloudElectric({
dbName,
migrationsDirectory: `./db/migrations`,
})

pooledDatabaseUri.apply(loadData)
pooledDatabaseUri.apply(loadData)

const website = new sst.aws.StaticSite(`linearlite-read-only`, {
environment: {
VITE_ELECTRIC_URL: process.env.ELECTRIC_API!,
VITE_ELECTRIC_SOURCE_SECRET: sourceSecret,
VITE_ELECTRIC_SOURCE_ID: sourceId,
},
build: {
command: `pnpm run --filter @electric-sql/client --filter @electric-sql/react --filter @electric-examples/linearlite-read-only build`,
output: `dist`,
},
domain: {
name: `linearlite-read-only${$app.stage === `production` ? `` : `-stage-${$app.stage}`}.electric-sql.com`,
dns: sst.cloudflare.dns(),
},
})
const website = new sst.aws.StaticSite(`linearlite-read-only`, {
environment: {
VITE_ELECTRIC_URL: process.env.ELECTRIC_API!,
VITE_ELECTRIC_SOURCE_SECRET: sourceSecret,
VITE_ELECTRIC_SOURCE_ID: sourceId,
},
build: {
command: `pnpm run --filter @electric-sql/client --filter @electric-sql/react --filter @electric-examples/linearlite-read-only build`,
output: `dist`,
},
domain: {
name: `linearlite-read-only${$app.stage === `production` ? `` : `-stage-${$app.stage}`}.electric-sql.com`,
dns: sst.cloudflare.dns(),
},
})

return {
website: website.url,
return {
website: website.url,
}
} catch (error) {
console.error(`Failed to deploy linearlite-read-only`, error)
}
},
})
Expand Down

0 comments on commit 4d2beb6

Please sign in to comment.