Skip to content

TOONPICK Backend CD Pipeline #16

TOONPICK Backend CD Pipeline

TOONPICK Backend CD Pipeline #16

Workflow file for this run

name: TOONPICK Backend CD Pipeline
on:
workflow_run:
workflows: ["TOONPICK Backend CI Pipeline"]
types:
- completed
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: EC2에 SSH 접속하여 배포 실행
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
# Secrets에서 환경 변수 가져오기
export DOCKER_HUB_USERNAME="${{ secrets.DOCKER_HUB_USERNAME }}"
export DOCKER_HUB_PASSWORD="${{ secrets.DOCKER_HUB_PASSWORD }}"
cd ~/TOONPICK
echo "최신 Docker Image Pull & 배포 시작..."
# 현재 실행 중인 서비스가 있으면 중지하지 않음
docker pull $DOCKER_HUB_USERNAME/toonpick-service-app:latest
docker-compose up -d