Skip to content

feat(api): Add preview endpoint (#6648) #1207

feat(api): Add preview endpoint (#6648)

feat(api): Add preview endpoint (#6648) #1207

name: Deploy DEV Worker
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
push:
branches:
- next
- main
paths:
- 'package.json'
- 'pnpm-lock.yaml'
- 'apps/api/**'
- 'libs/dal/**'
- 'packages/shared/**'
- 'libs/testing/**'
- 'libs/application-generic/**'
- 'packages/stateless/**'
- 'packages/node/**'
env:
TF_WORKSPACE: novu-dev
jobs:
test_worker:
strategy:
matrix:
name: ['novu/worker', 'novu/worker-ee']
uses: ./.github/workflows/reusable-worker-e2e.yml
with:
ee: ${{ contains (matrix.name,'-ee') }}
secrets: inherit
build_dev_worker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: test_worker
timeout-minutes: 80
environment: Development
permissions:
contents: read
packages: write
deployments: write
id-token: write
strategy:
matrix:
name: ['novu/worker-ee', 'novu/worker']
steps:
- uses: actions/checkout@v4
with:
submodules: ${{ contains (matrix.name,'-ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
- uses: ./.github/actions/setup-project
with:
submodules: ${{ contains (matrix.name,'-ee') }}
- uses: ./.github/actions/docker/build-worker
id: docker_build
with:
tag: dev
push: 'true'
github_token: ${{ secrets.GH_PACKAGES }}
docker_name: ${{ matrix.name }}
bullmq_secret: ${{ secrets.BULL_MQ_PRO_NPM_TOKEN }}
environment: dev
deploy_dev_workers:
needs: build_dev_worker
uses: ./.github/workflows/reusable-workers-service-deploy.yml
secrets: inherit
with:
environment: Development
terraform_workspace: novu-dev
# This is a workaround to an issue with matrix outputs
docker_image: ghcr.io/novuhq/novu/worker-ee:${{ github.sha }}
newrelic:
runs-on: ubuntu-latest
name: New Relic Deploy
needs: deploy_dev_workers
environment: Development
steps:
# This step builds a var with the release tag value to use later
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# This step creates a new Change Tracking Marker
- name: New Relic Application Deployment Marker
uses: newrelic/[email protected]
with:
region: EU
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: "MzgxMjQwOHxBUE18QVBQTElDQVRJT058NDk3NjQzODIy"
version: "${{ env.RELEASE_VERSION }}"
user: "${{ github.actor }}"