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
Copy Markdown

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