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: docker:dind privileged: true commands: - dockerd & - sleep 5 - docker build -t gptchat:latest . when: branch: - main event: - push - name: deploy image: docker:dind privileged: true commands: - dockerd & - sleep 5 - docker stop gptchat || true - docker rm gptchat || true - docker run -d \ --name gptchat \ -p 8484:8484 \ -v $(pwd)/data:/app/data \ --restart unless-stopped \ gptchat:latest when: branch: - main event: - push