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
27 changes: 23 additions & 4 deletions .github/workflows/CI.yml → .github/workflows/CI_CD.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
name: CI/CD

on:
push:
branches: [ "dev" ]

jobs:
build:
environment: env
Expand Down Expand Up @@ -104,5 +104,24 @@ jobs:
run: |
docker buildx build --platform linux/amd64 -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$TAG .
docker push $DOCKERHUB_USERNAME/$IMAGE_NAME:$TAG




deploy:
environment: env
# build 잡이 성공한 뒤에만 실행되도록 의존성 설정
needs: build
runs-on: ubuntu-latest

steps:
- name: SSH and Deploy
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.EC2_HOST }} # EC2 호스트 (IP 또는 도메인)
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
# Redis 컨테이너에서 flushall 명령 실행 (비대화형으로 실행)
docker exec redis-app redis-cli flushall

# 배포 스크립트 실행
./deploy.sh
File renamed without changes.