Conversation
WalkthroughGitHub Actions 워크플로우가 리팩토링되어 빌드와 배포 단계가 명확히 분리되었습니다. 빌드 작업은 병합된 PR에만 실행되며, 생성된 JAR 파일을 아티팩트로 업로드합니다. 배포 작업은 빌드 결과물을 다운로드하여 원격 서버에 복사하고 실행합니다. Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/spring-cd.yml (1)
29-33: 아티팩트 경로가 서브-모듈 JAR을 놓칠 수 있습니다.멀티-모듈 프로젝트라면
build/libs/**/*.jar로 지정해 두면 모든 하위 모듈의 산출물을 포괄할 수 있습니다.- path: build/libs/*.jar + path: build/libs/**/*.jar
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/spring-cd.yml(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/spring-cd.yml
15-15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
18-18: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
30-30: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
41-41: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (1)
.github/workflows/spring-cd.yml (1)
56-58: 원격 명령에도 동일한 경로 상수를 사용하고 있습니다.위에서 경로를 수정하면 여기도 함께 조정해야 합니다. 또한
docker compose대신docker-compose를 사용하는 호스트가 아직 있을 수 있으니 버전 확인이 필요합니다.
| - name: Checkout Repository | ||
| uses: actions/checkout@v3 | ||
|
|
There was a problem hiding this comment.
actions/checkout 버전을 v4로 올려야 최신 러너에서 동작합니다.
actionlint 경고대로 v3 러너는 더 이상 권장되지 않습니다. 이미 v4가 GA 상태이므로 바로 교체하는 편이 좋습니다.
- - name: Checkout Repository
- uses: actions/checkout@v3
+ - name: Checkout Repository
+ uses: actions/checkout@v4📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 |
🧰 Tools
🪛 actionlint (1.7.7)
15-15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents
In .github/workflows/spring-cd.yml around lines 14 to 16, the GitHub Actions
workflow uses actions/checkout@v3, which is outdated and not recommended for the
latest runners. Update the version from v3 to v4 by changing the uses line to
actions/checkout@v4 to ensure compatibility and follow best practices.
| - name: Copy JAR to EC2 | ||
| run: | | ||
| scp -i ${{secrets.EC2_SSH_KEY}} -o StrictHostKeyChecking=no build/libs/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/${{ secrets.EC2_USER }}/app/app.jar | ||
| scp -o StrictHostKeyChecking=no app-jar/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/ubuntu/app/app.jar | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
원격 경로가 사용자 고정값에 의존합니다.
/home/ubuntu/... 경로를 하드코딩하면 secrets.EC2_USER가 ubuntu가 아닐 때 실패합니다. 홈 디렉터리 ~ 를 사용하거나 별도 변수로 빼는 쪽이 안전합니다.
- scp -o StrictHostKeyChecking=no app-jar/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/ubuntu/app/app.jar
+ scp -o StrictHostKeyChecking=no app-jar/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:~/app/app.jar📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Copy JAR to EC2 | |
| run: | | |
| scp -i ${{secrets.EC2_SSH_KEY}} -o StrictHostKeyChecking=no build/libs/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/${{ secrets.EC2_USER }}/app/app.jar | |
| scp -o StrictHostKeyChecking=no app-jar/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:/home/ubuntu/app/app.jar | |
| - name: Copy JAR to EC2 | |
| run: | | |
| scp -o StrictHostKeyChecking=no app-jar/*.jar ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:~/app/app.jar |
🤖 Prompt for AI Agents
In .github/workflows/spring-cd.yml around lines 50 to 53, the remote path is
hardcoded to /home/ubuntu/app/app.jar which assumes the user is 'ubuntu'. To fix
this, replace the hardcoded path with a dynamic one using the home directory
shortcut ~ or define a separate variable for the user's home directory, then use
it in the scp command to ensure compatibility when secrets.EC2_USER is not
'ubuntu'.
Summary by CodeRabbit
/home/ubuntu/app)으로 지정되었습니다.