-
Notifications
You must be signed in to change notification settings - Fork 3
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
ci: add deploy Re:Earth CMS Web to Cloud Run workflow #346
Conversation
Signed-off-by: KeisukeYamashita <[email protected]>
WalkthroughThe pull request introduces significant changes to the Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHubActions
participant GoogleCloudRun
Developer->>GitHubActions: Trigger deployment
GitHubActions->>GitHubActions: Check repository conditions
alt Repository matches
GitHubActions->>GoogleCloudRun: Deploy CMS web application
GitHubActions->>GoogleCloudRun: Deploy worker application
else Repository does not match
GitHubActions->>Developer: Deployment skipped
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
.github/workflows/deploy-cms-dev.yml (3)
20-61
: LGTM with minor suggestions: Newdeploy_web
jobThe new
deploy_web
job is well-structured and follows GitHub Actions best practices. It correctly handles authentication, Docker configuration, and deployment to Google Cloud Run.However, there are some shell scripting practices that could be improved:
Use double quotes around variables to prevent globbing and word splitting. For example:
- docker pull $CMS_WEB_IMAGE_NAME + docker pull "$CMS_WEB_IMAGE_NAME"Apply this change to all shell commands in this job where variables are used.
These changes will make the script more robust against potential issues with special characters or spaces in variable values.
🧰 Tools
🪛 actionlint
44-44: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:32: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:32: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
Line range hint
63-120
: Consider tracking the removal ofdeploy_web_gcs
jobThe
deploy_web_gcs
job appears to be a legacy deployment method that's currently being maintained alongside the new Cloud Run deployment. While it's good to keep this as a fallback, it's important to track its eventual removal to avoid technical debt.Consider creating a GitHub issue to track the migration progress and the eventual removal of this job. This will help ensure that it's not forgotten once the migration to Cloud Run is complete.
🧰 Tools
🪛 actionlint
44-44: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:32: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:32: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
Line range hint
121-166
: LGTM with minor suggestions: Updateddeploy_server_worker
jobThe
deploy_server_worker
job has been successfully updated to use the new worker image variables, aligning with the changes made at the beginning of the file. The overall structure of the job is good and follows GitHub Actions best practices.However, similar to the
deploy_web
job, there are some shell scripting practices that could be improved:
Use double quotes around variables to prevent globbing and word splitting. For example:
- docker pull $CMS_IMAGE_NAME && docker pull $CMS_WORKER_IMAGE_NAME + docker pull "$CMS_IMAGE_NAME" && docker pull "$CMS_WORKER_IMAGE_NAME"Apply this change to all shell commands in this job where variables are used.
These changes will make the script more robust against potential issues with special characters or spaces in variable values.
🧰 Tools
🪛 actionlint
141-141: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
141-141: shellcheck reported issue in this script: SC2086:info:1:44: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:3:35: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:4:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:3:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:4:13: Double quote to prevent globbing and word splitting
(shellcheck)
155-155: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
155-155: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
155-155: shellcheck reported issue in this script: SC2086:info:7:11: Double quote to prevent globbing and word splitting
(shellcheck)
155-155: shellcheck reported issue in this script: SC2086:info:8:12: Double quote to prevent globbing and word splitting
(shellcheck)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/deploy-cms-dev.yml (3 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/deploy-cms-dev.yml
44-44: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:32: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:32: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
141-141: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
141-141: shellcheck reported issue in this script: SC2086:info:1:44: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:3:35: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:4:12: Double quote to prevent globbing and word splitting
(shellcheck)
143-143: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:3:13: Double quote to prevent globbing and word splitting
(shellcheck)
149-149: shellcheck reported issue in this script: SC2086:info:4:13: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (2)
.github/workflows/deploy-cms-dev.yml (2)
10-16
: LGTM: Well-structured environment variables for image managementThe addition of these environment variables for CMS web and worker images is a good practice. It centralizes the management of image names and improves the maintainability of the workflow. The naming convention is clear and consistent across different registries.
Line range hint
1-166
: Overall LGTM: Successful implementation of new deployment workflowThis PR successfully introduces the new deployment workflow for the Re:Earth CMS Web as intended. The changes align well with the PR objectives and maintain a good balance between introducing new functionality and preserving existing processes. Key points:
- New environment variables for CMS web and worker images have been added, improving maintainability.
- A new
deploy_web
job has been introduced to handle the deployment to Cloud Run.- The existing GCS deployment (
deploy_web_gcs
) is maintained as a fallback, with a TODO for future removal.- The
deploy_server_worker
job has been updated to use the new worker image variables.The structure of the workflow is clear and follows GitHub Actions best practices. Minor improvements to shell scripting practices have been suggested in previous comments.
Consider creating a GitHub issue to track the eventual removal of the
deploy_web_gcs
job once the migration to Cloud Run is complete.Great job on implementing these changes while maintaining backwards compatibility!
🧰 Tools
🪛 actionlint
44-44: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:1:32: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:12: Double quote to prevent globbing and word splitting
(shellcheck)
46-46: shellcheck reported issue in this script: SC2086:info:2:32: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
50-50: shellcheck reported issue in this script: SC2086:info:2:13: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
54-54: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
Why
Because now, the web is Dockerlized: reearth/reearth-cms#1253
Note that I didn't remove the existing deploy workflow to GCS.
Summary by CodeRabbit
New Features
deploy_web
job for streamlined deployment to Google Cloud Run.Bug Fixes