add profile #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |