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
52 changes: 52 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CD

on:
push:
branches: [ "main" ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# κΉƒ 레포 체크아웃
- name: Checkout repository
uses: actions/checkout@v4

# .env 생성
- name: Create .env file
run: echo "${{ secrets.ENV_FILE }}" > .env

# EC2둜 파일 전솑
- name: Copy files to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: 22
source: "docker-compose.yml,.env"
target: "/home/ubuntu/growin/"

# EC2μ—μ„œ 도컀 μ»¨ν…Œμ΄λ„ˆ 재배포
- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
Comment on lines +22 to +37
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

μ•‘μ…˜ 버전을 κ³ μ •ν•΄ μ£Όμ„Έμš”

appleboy/scp-action@master와 appleboy/ssh-action@masterλŠ” μ›€μ§μ΄λŠ” 브랜치λ₯Ό κ·ΈλŒ€λ‘œ λ”°λΌκ°€λ―€λ‘œ, μ•‘μ…˜μ΄ λ³€κ²½λ˜κ±°λ‚˜ μ˜€μ—Όλ  경우 배포 νŒŒμ΄ν”„λΌμΈ 전체가 영ν–₯을 λ°›μŠ΅λ‹ˆλ‹€. 릴리슀 νƒœκ·Έ(예: v0.1.x)λ‚˜ 컀밋 SHA둜 κ³ μ •ν•΄ 곡급망 μœ„ν—˜μ„ 쀄여 μ£Όμ„Έμš”.

πŸ€– Prompt for AI Agents
.github/workflows/cd.yml lines 22 to 37: the workflow uses floating refs
appleboy/scp-action@master and appleboy/ssh-action@master which risks
supply-chain breakage; update both action references to fixed release tags or
commit SHAs (e.g., a specific vX.Y.Z tag or the action's commit SHA) so the
workflow uses a stable known version, then commit and run the pipeline to verify
deployment still works.

port: 22
script: |
cd /home/ubuntu/growin

# 1. μ΅œμ‹  이미지 pull
sudo docker-compose pull

# 2. κΈ°μ‘΄ μ»¨ν…Œμ΄λ„ˆ 쀑단 및 μ‚­μ œ
sudo docker-compose down || true

# 3. μ»¨ν…Œμ΄λ„ˆ μž¬μ‹œμž‘
sudo docker-compose up -d

# 4. μ•ˆ μ“°λŠ” 이미지 정리
sudo docker image prune -a -f
File renamed without changes.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
growin-api:
image: ghcr.io/growin-2025/growin-server:latest
container_name: growin-api
ports:
- "8080:8080"
env_file:
- .env