-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.86 KB
/
lmbda-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy to AWS Lambda
on:
workflow_dispatch:
inputs:
app_url:
description: 'The application URL'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install pnpm and Set Up Global Bin Directory
run: npm install -g pnpm turbo ts-node
- name: prune
run: turbo prune --scope=api
- name: Install Dependencies
run: cd out && pnpm install --frozen-lockfile
- name: Seed into database
env:
AWS_DYNAMODB_ENDPOINT: ''
AWS_ACCESS_KEY_ID: ${{ secrets.SYGAR_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SYGAR_AWS_SECRET_ACCESS_KEY }}
SYGAR_DYNAMODB_REGION: ${{ secrets.SYGAR_DYNAMODB_REGION }}
SYGAR_PROJECT_NAME: ${{ secrets.SYGAR_PROJECT_NAME }}
NODE_ENV: ${{ secrets.NODE_ENV }}
SYGAR_ADMIN_EMAIL: ${{ secrets.SYGAR_ADMIN_EMAIL }}
SYGAR_ADMIN_PASSWORD: ${{ secrets.SYGAR_ADMIN_PASSWORD }}
SYGAR_USER_EMAIL: ${{ secrets.SYGAR_USER_EMAIL }}
SYGAR_USER_PASSWORD: ${{ secrets.SYGAR_USER_PASSWORD }}
run: |
cd out/apps/api
pnpm script:init
p
- name: Build the project
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 out/apps/api/dist && serverless deploy"
entrypoint: /bin/sh
env:
SYGAR_SERVERLESS: true
AWS_DYNAMODB_ENDPOINT: 'https://dynamodb.us-east-2.amazonaws.com'
AWS_ACCESS_KEY_ID: ${{ secrets.SYGAR_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SYGAR_AWS_SECRET_ACCESS_KEY }}
SYGAR_DYNAMODB_REGION: ${{ secrets.SYGAR_DYNAMODB_REGION }}
SYGAR_AUTH_WEB_APP_URL: ${{ github.event.inputs.app_url }}
SYGAR_PROJECT_NAME: ${{ secrets.SYGAR_PROJECT_NAME }}
NODE_ENV: ${{ secrets.NODE_ENV }}
SYGAR_ADMIN_EMAIL: ${{ secrets.SYGAR_ADMIN_EMAIL }}
SYGAR_ADMIN_PASSWORD: ${{ secrets.SYGAR_ADMIN_PASSWORD }}
SYGAR_USER_EMAIL: ${{ secrets.SYGAR_USER_EMAIL }}
SYGAR_USER_PASSWORD: ${{ secrets.SYGAR_USER_PASSWORD }}
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 }}
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 }}