feat(root): new deployment and rollback action#8126
Conversation
… repository prefix
…ment and production builds
…deployment matrix
…dling in deployment workflow
…nd adjust repository prefix
…e ECS deployment steps
…ate environment description
…f input for clarity
| if [ "${{ github.event.inputs.environment }}" == "development" ]; then | ||
| envs+=("\"development\"") | ||
| if [ "${{ github.event.inputs.environment }}" == "staging" ]; then | ||
| envs+=("\"staging-eu\"") |
There was a problem hiding this comment.
we have staging-eu?
There was a problem hiding this comment.
Staging exist in EU region. Some environments name were taken up here in actions. So I made parity in nomenclature with env-location.
| services+=("\"webhook\"") | ||
| fi | ||
|
|
||
| # Parse service secrets and generate deploy_matrix |
There was a problem hiding this comment.
where will we see those matrices? 👏
There was a problem hiding this comment.
Its for action to use 😅
| environment: ${{ fromJson(needs.prepare-matrix.outputs.env_matrix).environment[0] }} | ||
| outputs: | ||
| docker_image: ${{ steps.build-image.outputs.IMAGE }} | ||
| registry: ${{ steps.build-image.outputs.registry }} |
There was a problem hiding this comment.
is it common to call an image as registry?
There was a problem hiding this comment.
Actually, Let me remove this from here. We are not using this anymore because of matrix.
There was a problem hiding this comment.
where are the vars defined?
| }}${{ | ||
| github.event.inputs.deploy_ws == 'true' && 'ws, ' || '' | ||
| }}${{ | ||
| github.event.inputs.deploy_webhook == 'true' && 'webhook ' || '' |
There was a problem hiding this comment.
Webhook is not part of Novu V2, so I am not sure if we need it as an option.
| fi | ||
| if [ "${{ github.event.inputs.environment }}" == "production-us" ]; then | ||
| envs+=("\"production-us\"") | ||
| envs+=("\"prod-us\"") |
There was a problem hiding this comment.
Nit picky comment: I'd prefer production-us it's more descriptive ;)
There was a problem hiding this comment.
There is already a env with that name
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Get NPM Version |
There was a problem hiding this comment.
We don't use NPM semver for the services. We use it only for NPM packages. That is, I suggest using the latest commit hash to pinpoint the latest deployed code.
There was a problem hiding this comment.
I'll have another PR for this
| fi | ||
|
|
||
| # Parse service secrets and generate deploy_matrix | ||
| for service in "${services[@]}"; do |
There was a problem hiding this comment.
I am curious if there is a better way to construct this JSON using an inline node script or maybe zx from Google. This bash string interpolation is easy to understand but it's also super weird.
There was a problem hiding this comment.
Sure, I'll improve in later PR as it not pressing enough.

This pull request includes significant updates to the deployment workflow and Dockerfile configurations. The changes primarily focus on improving the deployment process by modifying environment settings, introducing new matrices, and updating Dockerfile bases.
Workflow Improvements:
.github/workflows/deploy.yml: Changed the default environment from 'development' to 'staging' and updated environment options. Removed question marks from descriptions..github/workflows/deploy.yml: Addeddeploy_matrixandnr_matrixto the outputs and steps for generating these matrices..github/workflows/deploy.yml: Introduced steps to parse service secrets and generatedeploy_matrix..github/workflows/deploy.yml: Modified the build step to use the newregistryoutput and updated the Docker build process..github/workflows/deploy.yml: Added new jobs for Sentry release, New Relic release, and syncing state to Novu.Dockerfile Updates:
apps/api/Dockerfile: Switched the base image fromnode:20-alpine3.19toghcr.io/novuhq/novu/base:1.0.0.apps/worker/Dockerfile: Added new lines for better readability and consistency.apps/ws/Dockerfile: Changed the base image toghcr.io/novuhq/novu/base:1.0.0and adjusted the file copy commands. [1] [2]