Skip to content

Commit b26edd1

Browse files
committed
Merge branch 'next' of github.com:novuhq/novu into ci/actions-internal-auth
2 parents 29f9467 + 3c14915 commit b26edd1

655 files changed

Lines changed: 30542 additions & 5182 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ run-name: >
88
}}${{
99
github.event.inputs.deploy_ws == 'true' && 'ws, ' || ''
1010
}}${{
11-
github.event.inputs.deploy_webhook == 'true' && 'webhook ' || ''
11+
github.event.inputs.deploy_webhook == 'true' && 'webhook, ' || ''
12+
}}${{
13+
github.event.inputs.deploy_inbound_mail == 'true' && 'inbound-mail ' || ''
1214
}}on ${{ github.event.inputs.environment }}
1315
description: |
1416
This workflow deploys the Novu Cloud application to different environments and services based on the selected options.
@@ -55,7 +57,12 @@ on:
5557
type: boolean
5658
default: false
5759
deploy_webhook:
58-
description: "Deploy Webhook"
60+
description: "Deploy Webhook (staging / production-us / production-eu only)"
61+
required: true
62+
type: boolean
63+
default: false
64+
deploy_inbound_mail:
65+
description: "Deploy Inbound Mail (staging / production-us / production-eu only)"
5966
required: true
6067
type: boolean
6168
default: false
@@ -75,15 +82,31 @@ jobs:
7582
INPUT_DEPLOY_WORKER: ${{ github.event.inputs.deploy_worker }}
7683
INPUT_DEPLOY_WS: ${{ github.event.inputs.deploy_ws }}
7784
INPUT_DEPLOY_WEBHOOK: ${{ github.event.inputs.deploy_webhook }}
85+
INPUT_DEPLOY_INBOUND_MAIL: ${{ github.event.inputs.deploy_inbound_mail }}
7886
run: |
7987
if [ "$INPUT_DEPLOY_API" != "true" ] && \
8088
[ "$INPUT_DEPLOY_WORKER" != "true" ] && \
8189
[ "$INPUT_DEPLOY_WS" != "true" ] && \
82-
[ "$INPUT_DEPLOY_WEBHOOK" != "true" ]; then
90+
[ "$INPUT_DEPLOY_WEBHOOK" != "true" ] && \
91+
[ "$INPUT_DEPLOY_INBOUND_MAIL" != "true" ]; then
8392
echo "Error: At least one service must be selected for deployment."
8493
exit 1
8594
fi
8695
96+
# webhook and inbound-mail only have infra in staging-eu, prod-us, prod-eu.
97+
# Fail fast if someone selects them with an unsupported environment.
98+
if [ "${{ github.event.inputs.deploy_webhook }}" = "true" ] || \
99+
[ "${{ github.event.inputs.deploy_inbound_mail }}" = "true" ]; then
100+
case "${{ github.event.inputs.environment }}" in
101+
staging|production-us|production-eu|production-us-and-eu) ;;
102+
*)
103+
echo "Error: webhook and inbound-mail can only deploy to staging, production-us, production-eu, or production-us-and-eu."
104+
echo "Selected environment: ${{ github.event.inputs.environment }}"
105+
exit 1
106+
;;
107+
esac
108+
fi
109+
87110
- name: Generate Environment, Service, and Deploy Matrices
88111
id: set-matrix
89112
env:
@@ -155,6 +178,9 @@ jobs:
155178
if [ "$INPUT_DEPLOY_WEBHOOK" == "true" ]; then
156179
services+=("\"webhook\"")
157180
fi
181+
if [ "${{ github.event.inputs.deploy_inbound_mail }}" == "true" ]; then
182+
services+=("\"inbound-mail\"")
183+
fi
158184
159185
# Parse service secrets and generate deploy_matrix
160186
for service in "${services[@]}"; do
@@ -233,6 +259,13 @@ jobs:
233259
task_name=webhook-task
234260
image=webhook
235261
deploy_matrix+=("{\"cluster_name\": \"$cluster_name\", \"container_name\": \"$container_name\", \"service_name\": \"$service_name\", \"task_name\": \"$task_name\", \"image\": \"$image\"}")
262+
elif [ "$service" == "\"inbound-mail\"" ]; then
263+
cluster_name=inbound-mail-cluster
264+
container_name=inbound-mail-container
265+
service_name=inbound-mail-service
266+
task_name=inbound-mail-task
267+
image=inbound-mail
268+
deploy_matrix+=("{\"cluster_name\": \"$cluster_name\", \"container_name\": \"$container_name\", \"service_name\": \"$service_name\", \"task_name\": \"$task_name\", \"image\": \"$image\"}")
236269
fi
237270
done
238271

.github/workflows/dev-deploy-inbound-mail.yml

Lines changed: 0 additions & 184 deletions
This file was deleted.

.github/workflows/on-push-trigger.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
DEPLOY_WORKER=false
5757
DEPLOY_WS=false
5858
DEPLOY_WEBHOOK=false
59+
DEPLOY_INBOUND_MAIL=false
5960
SKIP_DEPLOYMENT=false
6061
6162
# Check if only CI/CD label exists (standalone)
@@ -88,30 +89,44 @@ jobs:
8889
DEPLOY_WEBHOOK=true
8990
echo "Found @novu/webhook label"
9091
fi
92+
93+
if echo "$LABELS" | grep -q "@novu/inbound-mail"; then
94+
DEPLOY_INBOUND_MAIL=true
95+
echo "Found @novu/inbound-mail label"
96+
fi
9197
9298
# If no service labels found, deploy api and worker by default
93-
if [ "$DEPLOY_API" = "false" ] && [ "$DEPLOY_WORKER" = "false" ] && [ "$DEPLOY_WS" = "false" ] && [ "$DEPLOY_WEBHOOK" = "false" ]; then
99+
if [ "$DEPLOY_API" = "false" ] && [ "$DEPLOY_WORKER" = "false" ] && [ "$DEPLOY_WS" = "false" ] && [ "$DEPLOY_WEBHOOK" = "false" ] && [ "$DEPLOY_INBOUND_MAIL" = "false" ]; then
94100
echo "No service labels found, deploying api and worker by default"
95101
DEPLOY_API=true
96102
DEPLOY_WORKER=true
97103
fi
98104
fi
99105
106+
TRIGGER_DEPLOY=false
107+
if [ "$DEPLOY_API" = "true" ] || [ "$DEPLOY_WORKER" = "true" ] || [ "$DEPLOY_WS" = "true" ] || \
108+
[ "$DEPLOY_WEBHOOK" = "true" ] || [ "$DEPLOY_INBOUND_MAIL" = "true" ]; then
109+
TRIGGER_DEPLOY=true
110+
fi
111+
100112
echo "skip_deployment=$SKIP_DEPLOYMENT" >> $GITHUB_OUTPUT
113+
echo "trigger_deploy=$TRIGGER_DEPLOY" >> $GITHUB_OUTPUT
101114
echo "deploy_api=$DEPLOY_API" >> $GITHUB_OUTPUT
102115
echo "deploy_worker=$DEPLOY_WORKER" >> $GITHUB_OUTPUT
103116
echo "deploy_ws=$DEPLOY_WS" >> $GITHUB_OUTPUT
104117
echo "deploy_webhook=$DEPLOY_WEBHOOK" >> $GITHUB_OUTPUT
118+
echo "deploy_inbound_mail=$DEPLOY_INBOUND_MAIL" >> $GITHUB_OUTPUT
105119
106120
echo "Final deployment configuration:"
107121
echo " Skip: $SKIP_DEPLOYMENT"
108122
echo " API: $DEPLOY_API"
109123
echo " Worker: $DEPLOY_WORKER"
110124
echo " WS: $DEPLOY_WS"
111125
echo " Webhook: $DEPLOY_WEBHOOK"
126+
echo " Inbound Mail: $DEPLOY_INBOUND_MAIL"
112127
113128
- name: Trigger Deploy Workflow via GitHub CLI
114-
if: steps.determine-services.outputs.skip_deployment == 'false'
129+
if: steps.determine-services.outputs.skip_deployment == 'false' && steps.determine-services.outputs.trigger_deploy == 'true'
115130
env:
116131
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117132
run: |
@@ -121,4 +136,5 @@ jobs:
121136
-f deploy_api=${{ steps.determine-services.outputs.deploy_api }} \
122137
-f deploy_worker=${{ steps.determine-services.outputs.deploy_worker }} \
123138
-f deploy_ws=${{ steps.determine-services.outputs.deploy_ws }} \
124-
-f deploy_webhook=${{ steps.determine-services.outputs.deploy_webhook }}
139+
-f deploy_webhook=${{ steps.determine-services.outputs.deploy_webhook }} \
140+
-f deploy_inbound_mail=${{ steps.determine-services.outputs.deploy_inbound_mail }}

0 commit comments

Comments
 (0)