Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ nbdist
.env
.env.*
!.env.example
application-local.yml
application-dev.yml
application-prod.yml

logs
*.log
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CD Prod

on:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: deploy-prod
cancel-in-progress: false

jobs:
deploy-prod:
name: Deploy to Prod EC2
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the workflow file with line numbers around the referenced ranges.
file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


프로덕션 배포 액션을 커밋 SHA로 고정하세요. .github/workflows/cd-prod.yml의 22, 27, 40, 50행에서 actions/checkout@v4, actions/setup-java@v4, appleboy/scp-action@v1, appleboy/ssh-action@v1가 변경 가능한 태그를 사용합니다. 배포 경로에서는 태그 이동만으로 동작이 바뀔 수 있으니 전체 커밋 SHA로 바꾸고 버전 주석은 유지하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/cd-prod.yml at line 22, 프로덕션 배포 워크플로의 actions/checkout,
actions/setup-java, appleboy/scp-action, appleboy/ssh-action 사용을 변경 가능한 버전 태그에서
해당 액션의 전체 커밋 SHA로 고정하세요. 각 uses 항목의 기존 버전 주석은 유지하고, cd-prod.yml의 네 배포 액션 참조만
수정하세요.

with:
persist-credentials: false

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle

- name: Make Gradle Wrapper executable
run: chmod +x ./gradlew

- name: Test and build Spring Boot jar
run: ./gradlew clean test bootJar --no-daemon

- name: Copy jar to EC2
Comment thread
young0206 marked this conversation as resolved.
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.PROD_EC2_HOST }}
username: ${{ secrets.PROD_EC2_USERNAME }}
key: ${{ secrets.PROD_EC2_SSH_KEY }}
fingerprint: ${{ secrets.PROD_EC2_HOST_FINGERPRINT }}
source: build/libs/slatto.jar
target: /home/ubuntu/SLAT-TO-BE/build/libs/

- name: Deploy
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.PROD_EC2_HOST }}
username: ${{ secrets.PROD_EC2_USERNAME }}
key: ${{ secrets.PROD_EC2_SSH_KEY }}
fingerprint: ${{ secrets.PROD_EC2_HOST_FINGERPRINT }}
script: |
chmod +x /home/ubuntu/deploy/deploy.sh
/home/ubuntu/deploy/deploy.sh
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

tasks.named('bootJar') {
archiveFileName = 'slatto.jar'
}
Loading