Skip to content

Commit

Permalink
Merge branch 'next' into move-inbound-mail-parser-to-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
djabarovgeorge authored Jan 30, 2024
2 parents 241a2b6 + e5128e1 commit 5d8b78b
Show file tree
Hide file tree
Showing 170 changed files with 3,546 additions and 749 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,14 @@
"Stdev",
"openapi",
"headerapikey",
"fieldname",
"isend",
"Otel",
"opentelemetry",
"INITDB",
"isend",
"Idand"
"Idand",
"hubspot"
],
"flagWords": [],
"patterns": [
Expand Down
25 changes: 2 additions & 23 deletions .github/actions/docker/build-api/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,10 @@ runs:
shell: bash
run: pnpm build:api

- name: 🚢 Setup Depot
uses: depot/setup-action@v1
if: ${{ inputs.fork == 'false' }}
with:
oidc: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login To Registry
if: ${{ inputs.fork == 'false' }}
shell: bash
env:
GH_ACTOR: ${{ github.actor }}
Expand All @@ -61,30 +54,17 @@ runs:
echo "BULL_MQ_PRO_NPM_TOKEN=${{ inputs.bullmq_secret }}" >> $GITHUB_ENV
if: contains( inputs.docker_name , 'ee')

- name: Build with Depot, tag, and test - Regular
if: ${{ inputs.fork == 'false' }} # Use buildx for forks as they can't access secrets
- name: Build with Buildx, tag, and test
shell: bash
env:
REGISTRY_OWNER: novuhq
DOCKER_NAME: ${{ inputs.docker_name }}
IMAGE_TAG: ${{ github.sha }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ inputs.github_token }}
run: |
set -x
cd apps/api && pnpm run docker:build:depot --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN}
- name: Build with Buildx, tag, and test
if: ${{ inputs.fork == 'true' }} # Use buildx for forks as they can't access secrets
shell: bash
env:
REGISTRY_OWNER: novuhq
DOCKER_NAME: ${{ inputs.docker_name }}
IMAGE_TAG: ${{ github.sha }}
run: |
set -x
cd apps/api && pnpm run docker:build
cd apps/api && pnpm run docker:build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN}
- name: Tag and test
id: build-image
Expand All @@ -93,7 +73,6 @@ runs:
REGISTRY_OWNER: novuhq
DOCKER_NAME: ${{ inputs.docker_name }}
IMAGE_TAG: ${{ github.sha }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ inputs.github_token }}
run: |
Expand Down
22 changes: 0 additions & 22 deletions .github/actions/docker/build-worker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ runs:
shell: bash
run: pnpm build:worker

# - name: 🚢 Setup Depot
# uses: depot/setup-action@v1
# with:
# oidc: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -59,28 +54,12 @@ runs:
echo "BULL_MQ_PRO_NPM_TOKEN=${{ inputs.bullmq_secret }}" >> $GITHUB_ENV
if: contains(inputs.docker_name , 'ee')

# - name: Build with Depot, tag, and test - Regular
# if: ${{ inputs.fork == 'false' }} # Use buildx for forks as they can't access secrets
# shell: bash
# env:
# REGISTRY_OWNER: novuhq
# DOCKER_NAME: ${{ inputs.docker_name }}
# IMAGE_TAG: ${{ github.sha }}
# DEPOT_PROJECT_ID: 6sj0jfv0n7
# GH_ACTOR: ${{ github.actor }}
# GH_PASSWORD: ${{ inputs.github_token }}
# run: |
# set -x
# cd apps/worker && pnpm run docker:build:depot --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN}

- name: Build with Buildx, tag, and test
# if: ${{ inputs.fork == 'true' }} # Use buildx for forks as they can't access secrets
shell: bash
env:
REGISTRY_OWNER: novuhq
DOCKER_NAME: ${{ inputs.docker_name }}
IMAGE_TAG: ${{ github.sha }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ inputs.github_token }}
run: |
Expand All @@ -94,7 +73,6 @@ runs:
REGISTRY_OWNER: novuhq
DOCKER_NAME: ${{ inputs.docker_name }}
IMAGE_TAG: ${{ github.sha }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ inputs.github_token }}
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/run-backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ runs:
TZ: "UTC"
GITHUB_OAUTH_REDIRECT: "http://127.0.0.1:1336/v1/auth/github/callback"
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
CI_EE_TEST: "true"
run: cd apps/api && pnpm start:build &

- name: Start Worker
Expand All @@ -37,6 +38,7 @@ runs:
PORT: "1342"
TZ: "UTC"
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
CI_EE_TEST: "true"
run: cd apps/worker && pnpm start:prod &

- name: Wait on API and Worker
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dev-deploy-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ jobs:
project_path: libs/embed
local_tag: novu-embed
env_tag: dev
depot_project_id: f88777ff6m
secrets: inherit
8 changes: 1 addition & 7 deletions .github/workflows/dev-deploy-inbound-mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project

- name: Setup Depot
uses: depot/setup-action@v1
with:
oidc: true

- name: Set Bull MQ Env variable for EE
shell: bash
run: |
Expand All @@ -66,10 +61,9 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd apps/inbound-mail && pnpm --silent --workspace-root pnpm-context -- apps/inbound-mail/Dockerfile | depot build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/inbound-mail - -t novu-inbound-mail --load
cd apps/inbound-mail && pnpm --silent --workspace-root pnpm-context -- apps/inbound-mail/Dockerfile | docker build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/inbound-mail - -t novu-inbound-mail --load
docker tag novu-inbound-mail ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker tag novu-inbound-mail ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
react_app_sentry_dsn: https://2b5160da86384949be4cc66679c54e79@o1161119.ingest.sentry.io/6250907
react_app_environment: dev
react_app_mail_server_domain: dev.inbound-mail.novu.co
react_app_hubspot_embed: 44416662
netlify_deploy_message: Dev deployment
netlify_alias: dev
netlify_gh_env: development
Expand All @@ -51,5 +52,4 @@ jobs:
project_path: apps/web
local_tag: novu-web
env_tag: dev
depot_project_id: f88777ff6m
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/dev-deploy-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
health_check: true
local_tag: novu-webhook
env_tag: dev
depot_project_id: f88777ff6m
secrets: inherit

deploy_dev_webhook:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dev-deploy-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ jobs:
project_path: apps/widget
local_tag: novu-widget
env_tag: dev
depot_project_id: f88777ff6m
secrets: inherit
8 changes: 1 addition & 7 deletions .github/workflows/prod-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ jobs:
- name: build api
run: pnpm build:api --skip-nx-cache

- name: Setup Depot
uses: depot/setup-action@v1
with:
oidc: true

- name: Set Bull MQ Env variable for EE
if: contains(matrix.name, 'ee')
shell: bash
Expand All @@ -65,10 +60,9 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd apps/api && pnpm --silent --workspace-root pnpm-context -- apps/api/Dockerfile | depot build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/api - -t novu-api --load
cd apps/api && pnpm --silent --workspace-root pnpm-context -- apps/api/Dockerfile | docker build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/api - -t novu-api --load
docker tag novu-api ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest
docker tag novu-api ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod
docker tag novu-api ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-embed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ jobs:
project_path: libs/embed
local_tag: novu-embed
env_tag: prod
depot_project_id: f88777ff6m
secrets: inherit
8 changes: 1 addition & 7 deletions .github/workflows/prod-deploy-inbound-mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ jobs:
- name: build api
run: pnpm build:inbound-mail

- name: Setup Depot
uses: depot/setup-action@v1
with:
oidc: true

- name: Set Bull MQ Env variable for EE
if: contains(matrix.name, 'ee')
shell: bash
Expand All @@ -55,10 +50,9 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd apps/inbound-mail && pnpm --silent --workspace-root pnpm-context -- apps/inbound-mail/Dockerfile | depot build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/inbound-mail - -t novu-inbound-mail --load
cd apps/inbound-mail && pnpm --silent --workspace-root pnpm-context -- apps/inbound-mail/Dockerfile | docker build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/inbound-mail - -t novu-inbound-mail --load
docker tag novu-inbound-mail ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest
docker tag novu-inbound-mail ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod
docker tag novu-inbound-mail ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/prod-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
react_app_sentry_dsn: https://2b5160da86384949be4cc66679c54e79@o1161119.ingest.sentry.io/6250907
react_app_environment: production
react_app_mail_server_domain: eu.inbound-mail.novu.co
react_app_hubspot_embed: 44416662
netlify_deploy_message: Prod deployment
netlify_alias: prod
netlify_gh_env: Production
Expand All @@ -47,6 +48,7 @@ jobs:
react_app_sentry_dsn: https://2b5160da86384949be4cc66679c54e79@o1161119.ingest.sentry.io/6250907
react_app_environment: production
react_app_mail_server_domain: inbound-mail.novu.co
react_app_hubspot_embed: 44416662
netlify_deploy_message: Prod deployment
netlify_alias: prod
netlify_gh_env: Production
Expand All @@ -64,5 +66,4 @@ jobs:
project_path: apps/web
local_tag: novu-web
env_tag: prod
depot_project_id: f88777ff6m
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
health_check: true
local_tag: novu-webhook
env_tag: prod
depot_project_id: f88777ff6m
secrets: inherit

deploy_prod_webhook_eu:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ jobs:
project_path: apps/widget
local_tag: novu-widget
env_tag: prod
depot_project_id: f88777ff6m
secrets: inherit
8 changes: 1 addition & 7 deletions .github/workflows/prod-deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ jobs:
- name: build worker
run: pnpm build:worker --skip-nx-cache

- name: Setup Depot
uses: depot/setup-action@v1
with:
oidc: true

- name: Set Bull MQ Env variable for EE
if: contains(matrix.name, 'ee')
shell: bash
Expand All @@ -65,10 +60,9 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: 6sj0jfv0n7
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd apps/worker && pnpm --silent --workspace-root pnpm-context -- apps/worker/Dockerfile | depot build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/worker - -t novu-worker --load
cd apps/worker && pnpm --silent --workspace-root pnpm-context -- apps/worker/Dockerfile | docker build --build-arg BULL_MQ_PRO_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} --build-arg PACKAGE_PATH=apps/worker - -t novu-worker --load
docker tag novu-worker ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest
docker tag novu-worker ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:prod
docker tag novu-worker ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/reusable-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ on:
project_path:
required: true
type: string
# The ID of the depot project.
# Note: Currently we build everything under one project (it requires to set up the OIDC for each project and I had some issues with the Depot)
depot_project_id:
required: true
type: string
# The port used for testing. This is not a required input, and it defaults to '1341'.
# This value is added, so you can test the image after it's built in test mode and by doing a health-check.
test_port:
Expand All @@ -32,7 +27,7 @@ on:
required: false
default: false
type: boolean
# The tag under which the image is built, it should align with the name in the project command docker:build:depot
# The tag under which the image is built, it should align with the name in the project command docker:build
local_tag:
required: true
type: string
Expand Down Expand Up @@ -76,11 +71,6 @@ jobs:
slim: 'true'
submodules: ${{ contains (matrix.name,'-ee') }}

- name: Setup Depot
uses: depot/setup-action@v1
with:
oidc: true

- name: Build, tag, and push image to ghcr.io
id: build-image
if: ${{ inputs.env_tag == 'dev' || inputs.env_tag == 'stg' }}
Expand All @@ -93,10 +83,9 @@ jobs:
PROJECT_PATH: ${{ inputs.project_path }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: ${{ inputs.depot_project_id }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd $PROJECT_PATH && npm run docker:build:depot
cd $PROJECT_PATH && npm run docker:build
docker tag $LOCAL_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker tag $LOCAL_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$ENV_TAG
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
Expand All @@ -114,10 +103,9 @@ jobs:
PROJECT_PATH: ${{ inputs.project_path }}
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
DEPOT_PROJECT_ID: ${{ inputs.depot_project_id }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin
cd $PROJECT_PATH && npm run docker:build:depot
cd $PROJECT_PATH && npm run docker:build
docker tag $LOCAL_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker tag $LOCAL_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$ENV_TAG
docker tag $LOCAL_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/reusable-web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ on:
react_app_mail_server_domain:
required: true
type: string
react_app_hubspot_embed:
required: false
type: string
# Netlify inputs
netlify_deploy_message:
required: true
Expand Down Expand Up @@ -81,6 +84,7 @@ jobs:
echo REACT_APP_ENVIRONMENT=${{ inputs.react_app_environment }} >> .env
echo REACT_APP_MAIL_SERVER_DOMAIN=${{ inputs.react_app_mail_server_domain }} >> .env
echo REACT_APP_LAUNCH_DARKLY_CLIENT_SIDE_ID=${{ secrets.LAUNCH_DARKLY_CLIENT_SIDE_ID }} >> .env
echo REACT_APP_HUBSPOT_EMBED=${{ inputs.react_app_hubspot_embed }} >> .env
- name: Envsetup
working-directory: apps/web
Expand Down
Loading

0 comments on commit 5d8b78b

Please sign in to comment.