Skip to content

Commit

Permalink
Merge pull request #126 from wizelineacademy/github-actions
Browse files Browse the repository at this point in the history
fix: Fixed sst configuration
  • Loading branch information
JulioEmmmanuel authored Jun 2, 2024
2 parents f9e102c + 3785bf9 commit 6ee9bd3
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions sst.config.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
/// <reference path="./.sst/platform/config.d.ts" />

export default $config({

app(input) {
return {
name: "vita",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
};
name: 'vita',
removal: input?.stage === 'production' ? 'retain' : 'remove',
home: 'aws',
}
},

async run() {
const openApiKey = new sst.Secret("OpenApiKey");
const facebookId = new sst.Secret("FacebookId");
const facebookSecret = new sst.Secret("FacebookSecret");
const googleId = new sst.Secret("GoogleId");
const googleSecret = new sst.Secret("GoogleSecret");
const WebhookVerifyToken = new sst.Secret("WebhookVerifyToken");
const GraphApiToken = new sst.Secret("GraphApiToken");
const GeminiApiKey = new sst.Secret("GeminiApiKey")
const openApiKey = new sst.Secret('OpenApiKey')
const facebookId = new sst.Secret('FacebookId')
const facebookSecret = new sst.Secret('FacebookSecret')
const googleId = new sst.Secret('GoogleId')
const googleSecret = new sst.Secret('GoogleSecret')
const WebhookVerifyToken = new sst.Secret('WebhookVerifyToken')
const GraphApiToken = new sst.Secret('GraphApiToken')
const GeminiApiKey = new sst.Secret('GeminiApiKey')

const database = new sst.aws.Postgres("MyDatabase", {
const database = new sst.aws.Postgres('MyDatabase', {
scaling: {
min: "0.5 ACU",
max: "1 ACU"
}
min: '0.5 ACU',
max: '1 ACU',
},
})

const bucket = new sst.aws.Bucket("MyBucket", {
public: true
});
const bucket = new sst.aws.Bucket('MyBucket', {
public: true,
})

const blogCron = new sst.aws.Cron("MyCronJob", {
job: "src/cron_functions/blog.handler",
schedule: "cron(0 6 * * ? *)"
const blogCron = new sst.aws.Cron('MyCronJob', {
job: 'src/cron_functions/blog.handler',
schedule: 'cron(0 6 * * ? *)',
})

const remindersCron = new sst.aws.Cron("RemindersJob", {
job: "src/cron_functions/reminders.handler",
schedule: "rate(30 minutes)"
const remindersCron = new sst.aws.Cron('RemindersJob', {
job: 'src/cron_functions/reminders.handler',
schedule: 'rate(30 minutes)',
})

new sst.aws.Nextjs("MyWeb", {
new sst.aws.Nextjs('MyWeb', {
link: [
bucket,
database,
Expand All @@ -54,15 +53,12 @@ export default $config({
googleSecret,
WebhookVerifyToken,
GraphApiToken,
GeminiApiKey
GeminiApiKey,
],
environment: {
NEXTAUTH_URL: process.env.NEXTAUTH_URL!,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET!,
DATABASE_NAME: process.env.DATABASE_NAME!,
SERVICE_ARN: process.env.SERVICE_ARN!,
SECRET_ARN: process.env.SECRET_ARN!
}
});
},
})
},
});
})

0 comments on commit 6ee9bd3

Please sign in to comment.