Skip to content

Commit

Permalink
Fixed deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
hhassan01 committed Aug 31, 2024
1 parent cd7f6f5 commit 356f306
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ jobs:
with:
node-version: '20'

- name: Install serverless
run: npm install -g serverless

- name: Install dependencies
run: npm ci
run: npm install

- name: Deploy
run: npm run deploy
run: serverless deploy
env:
MONGODB_URI: ${{ secrets.MONGODB_URI_DEV }}
EVENT_BUS_NAME: ${{ secrets.EVENT_BUS_NAME_DEV }}
EVENT_SOURCE: ${{ secrets.EVENT_SOURCE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCOUNT_REGION: ${{ secrets.AWS_ACCOUNT_REGION }}
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}

16 changes: 14 additions & 2 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ jobs:
with:
node-version: '20'

- name: Install serverless
run: npm install -g serverless

- name: Install dependencies
run: npm ci
run: npm install

- name: Deploy
run: npm run deploy:prod
run: serverless deploy -s production
env:
MONGODB_URI: ${{ secrets.MONGODB_URI_PROD }}
EVENT_BUS_NAME: ${{ secrets.EVENT_BUS_NAME_PROD }}
EVENT_SOURCE: ${{ secrets.EVENT_SOURCE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCOUNT_REGION: ${{ secrets.AWS_ACCOUNT_REGION }}
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"scripts": {
"clean": "rm -rf dist build",
"build": "npm run clean && tsc",
"deploy": "serverless deploy -s dev -v",
"deploy:prod": "serverless deploy -s production -v",
"deploy": "serverless deploy -s dev",
"deploy:prod": "serverless deploy -s production",
"offline": "npm run build && serverless offline",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down

0 comments on commit 356f306

Please sign in to comment.