Update .gitea/workflows/deploy.yml
Some checks failed
Deploy VConnect API / Test Build (push) Has been cancelled
Some checks failed
Deploy VConnect API / Test Build (push) Has been cancelled
This commit is contained in:
@@ -3,45 +3,25 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch: # 수동 실행 가능
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python
|
- name: List files
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
echo "=== 파일 목록 ==="
|
||||||
pip install -r requirements.txt
|
ls -la
|
||||||
|
|
||||||
- name: Run tests
|
- name: Check Python
|
||||||
run: |
|
run: |
|
||||||
echo "테스트 실행 중..."
|
echo "=== Python 버전 ==="
|
||||||
# pytest가 있다면: pytest
|
python3 --version
|
||||||
python -m pytest || echo "테스트 스킵"
|
|
||||||
|
|
||||||
deploy:
|
- name: Success
|
||||||
name: Deploy to Server
|
run: echo "CI/CD 테스트 성공!"
|
||||||
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 "배포 완료!"
|
|
||||||
Reference in New Issue
Block a user