Files
gptchat/.drone.yml
2026-04-03 15:46:17 +10:00

47 lines
1.1 KiB
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: build-image
image: plugins/docker
settings:
repo: gptchat
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
dockerfile: Dockerfile
context: .
when:
branch:
- main
event:
- push
- name: deploy
image: appleboy/drone-ssh
settings:
host: gitea.allowlgroup.ru
username:
from_secret: ssh_username
key:
from_secret: ssh_private_key
port: 22
script:
- cd /opt/gptchat || 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