Skip to content

Merge pull request #5149 from novuhq/NV-3474 #1

Merge pull request #5149 from novuhq/NV-3474

Merge pull request #5149 from novuhq/NV-3474 #1

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'
- 'yarn.lock'
- 'apps/api/**'
- 'libs/dal/**'
- 'libs/shared/**'
- 'libs/testing/**'
- 'packages/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:
if: "!contains(github.event.head_commit.message, 'ci skip')"
# 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@v3
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 }}
# Temporary for the migration phase
deploy_general_worker:
needs: build_dev_worker
uses: ./.github/workflows/reusable-app-service-deploy.yml
secrets: inherit
with:
environment: Development
service_name: worker
terraform_workspace: novu-dev
# This is a workaround to an issue with matrix outputs
docker_image: ghcr.io/novuhq/novu/worker-ee:${{ github.sha }}
deploy_dev_workers:
needs: deploy_general_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 }}"