Update .gitea/workflows/deploy.yml
Some checks failed
Deploy VConnect API / Test Build (push) Has been cancelled

This commit is contained in:
2025-12-13 20:46:26 +09:00
parent b0eff846de
commit 62f9c62928

View File

@@ -3,45 +3,25 @@ on:
push:
branches:
- main
workflow_dispatch: # 수동 실행 가능
workflow_dispatch:
jobs:
test:
name: Test
name: Test Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
- name: List files
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
echo "=== 파일 목록 ==="
ls -la
- name: Check Python
run: |
echo "테스트 실행 중..."
# pytest가 있다면: pytest
python -m pytest || echo "테스트 스킵"
deploy:
name: Deploy to Server
runs-on: ubuntu-latest
needs: test # test 성공 후 실행
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy via SSH
run: |
echo "배포 시작..."
# SSH 설정 후 주석 해제:
# mkdir -p ~/.ssh
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh-keyscan -H 192.168.0.97 >> ~/.ssh/known_hosts
# ssh user@192.168.0.97 "cd /path/to/vconnect-api && git pull && systemctl restart vconnect-api"
echo "배포 완료!"
echo "=== Python 버전 ==="
python3 --version
- name: Success
run: echo "CI/CD 테스트 성공!"