-
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 production GitHub Actions workflow #347
Conversation
Signed-off-by: KeisukeYamashita <[email protected]>
WalkthroughThe changes in the Changes
Possibly related PRs
Suggested labels
Poem
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 (5)
.github/workflows/deploy-cms-prod.yml (5)
43-54
: Approve with minor suggestions: Docker image management steps.The steps for pulling and pushing the Docker image are logically structured. However, consider quoting the environment variables to prevent potential issues with word splitting or globbing:
- docker pull $CMS_WEB_IMAGE_NAME_GHCR + docker pull "$CMS_WEB_IMAGE_NAME_GHCR" - docker tag $CMS_WEB_IMAGE_NAME_GHCR $CMS_WEB_IMAGE_NAME_GCP \ - && docker push $CMS_WEB_IMAGE_NAME_GCP + docker tag "$CMS_WEB_IMAGE_NAME_GHCR" "$CMS_WEB_IMAGE_NAME_GCP" \ + && docker push "$CMS_WEB_IMAGE_NAME_GCP"This change will make the script more robust against potential errors.
🧰 Tools
🪛 actionlint
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:37: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:2:16: Double quote to prevent globbing and word splitting
(shellcheck)
55-63
: Approve with minor suggestions: Deployment step.The deployment step correctly uses
gcloud run deploy
to deploy the CMS web image to Google Cloud Run. However, consider quoting the environment variables to prevent potential issues:gcloud run deploy reearth-cms-web \ - --image $CMS_WEB_IMAGE_NAME_GCP \ - --region $GCP_REGION \ + --image "$CMS_WEB_IMAGE_NAME_GCP" \ + --region "$GCP_REGION" \ --platform managed \ --quietThis change will make the script more robust against potential errors.
🧰 Tools
🪛 actionlint
56-56: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
160-160
: Approve with minor suggestions: Updates to push_hub job.The changes to include the CMS web image in the
push_hub
job are appropriate and consistent with the addition of the new component. However, consider quoting the environment variables to prevent potential issues:- run: docker pull $CMS_IMAGE_NAME_GHCR && docker pull $CMS_WEB_IMAGE_NAME_GHCR && docker pull $WORKER_IMAGE_NAME_GHCR + run: docker pull "$CMS_IMAGE_NAME_GHCR" && docker pull "$CMS_WEB_IMAGE_NAME_GHCR" && docker pull "$WORKER_IMAGE_NAME_GHCR" - run: docker tag $CMS_WEB_IMAGE_NAME_GHCR $CMS_WEB_IMAGE_NAME_HUB && docker push $CMS_WEB_IMAGE_NAME_HUB + run: docker tag "$CMS_WEB_IMAGE_NAME_GHCR" "$CMS_WEB_IMAGE_NAME_HUB" && docker push "$CMS_WEB_IMAGE_NAME_HUB"These changes will make the script more robust against potential errors.
Also applies to: 168-169
🧰 Tools
🪛 actionlint
160-160: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
160-160: shellcheck reported issue in this script: SC2086:info:1:49: Double quote to prevent globbing and word splitting
(shellcheck)
160-160: shellcheck reported issue in this script: SC2086:info:1:89: Double quote to prevent globbing and word splitting
(shellcheck)
65-66
: Create a follow-up task for removing deploy_web_gcs job.The TODO comment indicates that this job should be removed after migrating to Cloud Run. To ensure this doesn't get overlooked:
- Create a follow-up task or issue to remove this job after the migration is complete.
- Include a target date or milestone for the removal to keep it on the team's radar.
This will help maintain a clean and efficient workflow file in the future.
Would you like me to create a GitHub issue to track the removal of the
deploy_web_gcs
job?
11-11
: Remove trailing spaces.There are trailing spaces on this line. While they don't affect functionality, it's good practice to remove them to maintain clean and consistent code.
- CMS_IMAGE_NAME_GHCR: ghcr.io/eukarya-inc/plateau-view-3.0/reearth-cms:latest - + CMS_IMAGE_NAME_GHCR: ghcr.io/eukarya-inc/plateau-view-3.0/reearth-cms:latest +This change will resolve the yamllint warning and improve code cleanliness.
🧰 Tools
🪛 yamllint
[error] 11-11: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/deploy-cms-prod.yml (2 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/deploy-cms-prod.yml
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:37: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:2:16: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
160-160: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
160-160: shellcheck reported issue in this script: SC2086:info:1:49: Double quote to prevent globbing and word splitting
(shellcheck)
160-160: shellcheck reported issue in this script: SC2086:info:1:89: Double quote to prevent globbing and word splitting
(shellcheck)
167-167: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
167-167: shellcheck reported issue in this script: SC2086:info:1:33: Double quote to prevent globbing and word splitting
(shellcheck)
167-167: shellcheck reported issue in this script: SC2086:info:1:68: Double quote to prevent globbing and word splitting
(shellcheck)
169-169: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
169-169: shellcheck reported issue in this script: SC2086:info:1:37: Double quote to prevent globbing and word splitting
(shellcheck)
169-169: shellcheck reported issue in this script: SC2086:info:1:76: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 yamllint
.github/workflows/deploy-cms-prod.yml
[error] 11-11: trailing spaces
(trailing-spaces)
🔇 Additional comments (3)
.github/workflows/deploy-cms-prod.yml (3)
16-18
: LGTM: New environment variables for CMS web image.The addition of these environment variables for the CMS web image is consistent with the existing pattern for other components. This approach provides flexibility in managing images across different registries.
26-33
: LGTM: New deploy_web job added.The new
deploy_web
job is well-structured and follows best practices for GitHub Actions. It correctly uses environment secrets and variables, and is properly conditioned to run only for the intended repository.
Line range hint
1-171
: Overall approval: CMS production deployment workflow updates.The changes to this workflow file effectively introduce the deployment process for the CMS web component while maintaining consistency with existing practices. The new
deploy_web
job and associated environment variables are well-structured and logically integrated into the workflow.Key points:
- New environment variables for the CMS web image are appropriately defined.
- The
deploy_web
job is correctly configured for deploying to Google Cloud Run.- The
push_hub
job has been updated to include the CMS web image.Minor improvements have been suggested throughout the review, mainly focused on:
- Quoting environment variables to prevent potential issues with word splitting or globbing.
- Removing trailing spaces for better code cleanliness.
- Creating a follow-up task for the eventual removal of the
deploy_web_gcs
job.These suggested changes will further enhance the robustness and maintainability of the workflow. Overall, the modifications align well with the PR objectives and contribute to improving the CI/CD capabilities of the project.
🧰 Tools
🪛 actionlint
50-50: shellcheck reported issue in this script: SC2086:info:1:13: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:12: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:1:37: Double quote to prevent globbing and word splitting
(shellcheck)
52-52: shellcheck reported issue in this script: SC2086:info:2:16: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:2:11: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:3:12: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 yamllint
[error] 11-11: trailing spaces
(trailing-spaces)
Why
To deploy the dockerized Re:Earth CMS frontend to Cloud Run and manage Docker images.
Ref
Summary by CodeRabbit
New Features
Improvements