Skip to content

Commit

Permalink
chore: fix ENV VAR NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
anasjaidi committed Nov 14, 2024
1 parent 2ad5a35 commit 7e9f857
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 113 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/lmbda-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@ jobs:
node-version: '18'

- name: Install pnpm and Set Up Global Bin Directory
run: npm install -g pnpm
run: npm install -g pnpm turbo

- name: prune
run: turbo prune --scope=api

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: cd out && pnpm install --frozen-lockfile

- name: mv serverless config
run: mv serverless.yml out

- name: Build the project
run: pnpm turbo build --filter=api # Builds the project before deployment
run: cd out && pnpm turbo build --filter=api # Builds the project before deployment

- name: Deploy with Serverless
uses: serverless/github-action@v3
with:
args: -c "cd ./apps/api && serverless deploy"
args: -c "cd out && serverless deploy"
entrypoint: /bin/sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SYGAR_AWS_ACCESS_KEY_ID }}
Expand All @@ -44,7 +50,7 @@ jobs:
SYGAR_JWT_SECRET_TOKEN: ${{ secrets.SYGAR_JWT_SECRET_TOKEN }}
SYGAR_JWT_EXPIRATION_TIME: ${{ secrets.SYGAR_JWT_EXPIRATION_TIME }}
SYGAR_MAILER_HOST: ${{ secrets.SYGAR_MAILER_HOST }}
SYAGR_MAILER_PORT: ${{ secrets.SYAGR_MAILER_PORT }}
SYGAR_MAILER_PORT: ${{ secrets.SYGAR_MAILER_PORT }}
SYGAR_MAILER_USERNAME: ${{ secrets.SYGAR_MAILER_USERNAME }}
SYGAR_MAILER_PASSWORD: ${{ secrets.SYGAR_MAILER_PASSWORD }}
SYGAR_MAILER_FROM_ADDRESS: ${{ secrets.SYGAR_MAILER_FROM_ADDRESS }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ yarn-error.log*
# Misc
.DS_Store
*.pem
.pnpm*
2 changes: 2 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"rxjs": "^7.8.1",
"socket.io": "^4.8.0",
"swagger-ui-express": "^5.0.1",
"tslib": "^2.8.1",
"uid": "^2.0.2",
"uuid": "^10.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiResponse } from '@nestjs/swagger';

@Controller()
export class AppController {
constructor() {}
constructor() { }

@Get('healthcheck')
@ApiResponse({
Expand Down
45 changes: 45 additions & 0 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,48 @@ export const handler: Handler = async (event: any, context: Context, callback: C
}
return server(event, context, callback); // Update this line
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// import { NestFactory } from '@nestjs/core';
// import { AppModule } from './app.module';
// import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
// import { join } from 'path';
// import { NestExpressApplication } from '@nestjs/platform-express';
// import { ValidationPipe } from '@nestjs/common';
//
// async function bootstrap() {
// const app = await NestFactory.create<NestExpressApplication>(AppModule);
//
// app.enableCors({
// origin: 'http://localhost:3000',
// credentials: true,
// })
// const config = new DocumentBuilder()
// .setTitle('API Documentation')
// .setDescription('API description')
// .setVersion('1.0')
// .addTag('api')
// .build();
//
// const document = SwaggerModule.createDocument(app, config);
// SwaggerModule.setup('api/docs', app, document);
//
// app.useStaticAssets(join(__dirname, '..', 'public'));
// app.setBaseViewsDir(join(__dirname, '..', 'views'));
// app.setViewEngine('ejs');
//
// app.useGlobalPipes(new ValidationPipe({
// whitelist: true,
// transform: true,
// forbidNonWhitelisted: true,
// transformOptions: {
// enableImplicitConversion: true,
// },
// }));
//
// await app.listen(1338);
// }
//
// bootstrap()
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
},
"devDependencies": {
"prettier": "^3.2.5",
"serverless": "^4.4.7",
"serverless-offline": "^14.3.4",
"serverless-plugin-optimize": "4.2.1-rc.1",
"turbo": "^2.1.1",
"typescript": "^5.4.5"
},
Expand Down
Loading

0 comments on commit 7e9f857

Please sign in to comment.