Update .gitea/workflows/deploy.yml
Some checks failed
Deploy VConnect API / Test Build (push) Failing after 7s
Deploy VConnect API / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-12-13 22:38:53 +09:00
parent 9412f72cb3
commit ad18133ab2

View File

@@ -11,17 +11,16 @@ jobs:
name: Test Build name: Test Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Node 기반 컨테이너 (checkout 액션 필수) # Node 포함 컨테이너 (act_runner + Gitea Actions 필수)
container: node:18-bullseye container: node:18-bullseye
steps: steps:
# 1Checkout (최소 옵션으로 최적화) # 1내부 네트워크로 직접 Clone (checkout 액션 제거)
- name: Checkout code - name: Checkout repository (internal)
uses: actions/checkout@v3 run: |
with: echo "📥 Internal git clone start"
fetch-depth: 1 git clone --depth 1 http://server:3000/Kim.KANGHEE/vconnect-api.git .
submodules: false echo "📥 Clone done"
lfs: false
# 2⃣ Python 설치 # 2⃣ Python 설치
- name: Install Python - name: Install Python
@@ -39,12 +38,12 @@ jobs:
pip3 install -r requirements.txt pip3 install -r requirements.txt
fi fi
# 4⃣ 기본 테스트 # 4⃣ 기본 테스트 (지금은 echo, 이후 pytest 등으로 교체 가능)
- name: Run basic tests - name: Run basic tests
run: | run: |
echo "✅ 코드 체크아웃 성공" echo "✅ Code checkout success"
echo "✅ Python 환경 준비 완료" echo "✅ Python ready"
echo "✅ 의존성 설치 완료" echo "✅ Dependencies installed"
deploy: deploy:
name: Deploy to Server name: Deploy to Server
@@ -58,36 +57,36 @@ jobs:
run: | run: |
set -e set -e
echo "🔐 SSH 설정 중..." echo "🔐 SSH key setup"
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 192.168.0.97 >> ~/.ssh/known_hosts ssh-keyscan -H 192.168.0.97 >> ~/.ssh/known_hosts
echo "🚀 서버 배포 시작" echo "🚀 Deploy start"
ssh kdesk84@192.168.0.97 << 'EOF' ssh kdesk84@192.168.0.97 << 'EOF'
set -e set -e
echo "📂 프로젝트 디렉토리 이동" echo "📂 Move to project directory"
cd /data/vconnect-api cd /data/vconnect-api
echo "📦 최신 코드 가져오기" echo "📦 Git pull"
git pull origin main git pull origin main
echo "🐍 가상환경 활성화" echo "🐍 Activate virtualenv"
source venv/bin/activate source venv/bin/activate
echo "📦 의존성 업데이트" echo "📦 Install dependencies"
pip install -r requirements.txt pip install -r requirements.txt
echo "🔄 서비스 재시작" echo "🔄 Restart service"
sudo systemctl restart vconnect-api sudo systemctl restart vconnect-api
echo "📋 서비스 상태 확인" echo "📋 Service status"
sudo systemctl status vconnect-api --no-pager -l sudo systemctl status vconnect-api --no-pager -l
echo "✅ 배포 완료" echo "✅ Deploy finished"
EOF EOF
- name: Deployment Complete - name: Deployment Complete
run: echo "🎉 VConnect API 배포 완료!" run: echo "🎉 VConnect API deployment completed!"