-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(root): new deployment and rollback action #8126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… repository prefix
…ment and production builds
…deployment matrix
…dling in deployment workflow
…nd adjust repository prefix
…e ECS deployment steps
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have staging-eu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where will we see those matrices? 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its for action to use 😅
.github/workflows/deploy.yml
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it common to call an image as registry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, Let me remove this from here. We are not using this anymore because of matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the vars defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the GitHub Settings
| }}${{ | ||
| github.event.inputs.deploy_ws == 'true' && 'ws, ' || '' | ||
| }}${{ | ||
| github.event.inputs.deploy_webhook == 'true' && 'webhook ' || '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit picky comment: I'd prefer production-us it's more descriptive ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]