31 lines
711 B
YAML
31 lines
711 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: build-and-deploy
|
|
image: docker:latest
|
|
volumes:
|
|
- name: docker-socket
|
|
path: /var/run
|
|
commands:
|
|
- docker build -t gptchat:latest .
|
|
- docker stop gptchat || true
|
|
- docker rm gptchat || true
|
|
- docker run -d --name gptchat -p 8484:8484 --restart unless-stopped gptchat:latest
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
volumes:
|
|
- name: docker-socket
|
|
host:
|
|
path: /var/run/docker.sock |