Skip to content

Commit

Permalink
chore: add pnpm as a context for serverless framwork
Browse files Browse the repository at this point in the history
  • Loading branch information
anasjaidi committed Nov 10, 2024
1 parent 0380639 commit bfde2b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/lmbda-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
name: Deploy to AWS Lambda

on:
workflow_dispatch:
push:
workflow_dispatch: {}

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Check out code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
run: npm install -g pnpm
- name: Install pnpm and Set Up Global Bin Directory
run: |
npm install -g pnpm
pnpm setup
env:
PNPM_HOME: $HOME/.pnpm
PATH: $PNPM_HOME:$PATH

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

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

- name: Deploy with Serverless
env:
Expand All @@ -44,4 +45,6 @@ jobs:
SYGAR_MAILER_USERNAME: ${{ secrets.SYGAR_MAILER_USERNAME }}
SYGAR_MAILER_PASSWORD: ${{ secrets.SYGAR_MAILER_PASSWORD }}
SYGAR_MAILER_FROM_ADDRESS: ${{ secrets.SYGAR_MAILER_FROM_ADDRESS }}
run: cd apps/api && pnpm serverless deploy
run: |
cd apps/api
pnpm exec serverless deploy
2 changes: 2 additions & 0 deletions apps/api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ provider:
region: us-east-1
memorySize: 512
timeout: 30
custom:
packageManager: pnpm
environment:
SYGAR_DYNAMODB_REGION: ${env:SYGAR_DYNAMODB_REGION}
SYGAR_AUTH_WEB_APP_URL: ${env:SYGAR_AUTH_WEB_APP_URL}
Expand Down

0 comments on commit bfde2b0

Please sign in to comment.