34 lines
809 B
YAML
34 lines
809 B
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: test
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install --no-cache-dir -r requirements.txt
|
|
- pip install pytest pytest-asyncio
|
|
- pytest tests/ -v || true
|
|
|
|
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host: localhost
|
|
username:
|
|
from_secret: ssh_username
|
|
password:
|
|
from_secret: ssh_password
|
|
port: 22
|
|
script:
|
|
- mkdir -p /opt/gptchat
|
|
- cd /opt/gptchat && docker build -t gptchat:latest .
|
|
- docker stop gptchat || true
|
|
- docker rm gptchat || true
|
|
- docker run -d --name gptchat -p 8484:8484 -v /opt/gptchat/data:/app/data --restart unless-stopped gptchat:latest
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|