Skip to content

chore(app): migrate to yarn 4 (#61) #12

chore(app): migrate to yarn 4 (#61)

chore(app): migrate to yarn 4 (#61) #12

name: Deploy Code Embed
on:
push:
branches:
- main
- dev
paths:
- 'packages/database/prisma/**'
- 'packages/database/src/**'
- 'apps/functions/code-embed/src/**'
- 'apps/functions/code-embed/serverless.ts'
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ (github.ref == 'refs/heads/main' && 'Production') || 'Development' }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
EMBED_STYLE_URL: ${{ secrets.EMBED_STYLE_URL }}
EMBED_JS_URL: ${{ secrets.EMBED_JS_URL }}
WEB_APP_URL: ${{ secrets.WEB_APP_URL }}
WEB_APP_SNIPPET_VIEW_URL: ${{ secrets.WEB_APP_SNIPPET_VIEW_URL }}
ENV: ${{ secrets.ENV }}
SENTRY_DSN: ${{ secrets.CODE_EMBED_SENTRY_DSN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4
- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install projects dependencies
uses: bahmutov/npm-install@v1
- name: Deploy the application in staging
working-directory: 'apps/functions/code-embed'
if: ${{ github.ref == 'refs/heads/dev' }}
run: |
yarn setup:layer:remote
yarn sls deploy --stage dev
- name: Deploy the application in production
working-directory: 'apps/functions/code-embed'
if: ${{ github.ref == 'refs/heads/main' }}
run: |
yarn setup:layer:remote
yarn sls deploy --stage prod