From b938df65da0bb00e1caa94a2faae5deca07ca4e5 Mon Sep 17 00:00:00 2001 From: aengzu Date: Tue, 17 Dec 2024 15:36:09 +0900 Subject: [PATCH] Add CI/CD pipeline --- backend/.github/workflows/deploy.yml | 42 ---------------------------- 1 file changed, 42 deletions(-) delete mode 100644 backend/.github/workflows/deploy.yml diff --git a/backend/.github/workflows/deploy.yml b/backend/.github/workflows/deploy.yml deleted file mode 100644 index d43bfcf..0000000 --- a/backend/.github/workflows/deploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CI/CD Pipeline - -on: - push: - branches: - - main # main 브랜치에 푸시될 때 실행 - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - # 1. 코드 체크아웃 - - name: Checkout Code - uses: actions/checkout@v3 - - # 2. Docker 이미지 빌드 - - name: Build Docker Image - run: | - docker build -t backend_server . - - # 3. 서버에 코드 및 이미지 전송 - - name: Deploy to EC2 - uses: appleboy/scp-action@v0.1.4 - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - source: "./*" - target: "/home/ubuntu/backend" - - # 4. 서버에서 Docker Compose 실행 - - name: SSH into EC2 and restart Docker Compose - uses: appleboy/ssh-action@v1.0.0 - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - script: | - cd /home/ubuntu/backend - docker-compose down - docker-compose up -d --build