-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (47 loc) · 1.62 KB
/
deploy-lambda.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
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