Skip to content

chore(app): implement release process (#65) #1

chore(app): implement release process (#65)

chore(app): implement release process (#65) #1

Workflow file for this run

name: Deploy Code Embed
on:
push:
branches:
- dev
paths:
- 'packages/database/prisma/**'
- 'packages/database/src/**'
- 'apps/functions/code-embed/src/**'
- 'apps/functions/code-embed/serverless.ts'
workflow_dispatch:
inputs:
version:
description: 'New version of the lambda to release'
type: string
required: true
default: 'latest'
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: Install dependencies
uses: ./.github/actions/install-dependencies
- 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