diff --git a/.drone.yml b/.drone.yml index 67f2c87..48d34d4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,33 +1,42 @@ + kind: pipeline type: docker name: default steps: - - name: build - image: python:3.11-slim - commands: - - pip install --no-cache-dir -r requirements.txt +- name: build - - name: deploy - image: appleboy/drone-ssh - settings: - host: 127.0.0.1 - username: - from_secret: ssh_username - password: - from_secret: ssh_password - port: 22 - script: - - export DOCKER_HOST="unix:///var/run/docker.sock" - - docker stop gptchat || true - - docker rm gptchat || true - - docker pull gitea.allowlgroup.ru/allowlgroup/gptchat:latest - - docker run -d --name gptchat -p 8484:8484 gitea.allowlgroup.ru/allowlgroup/gptchat:latest - when: - branch: - - main - event: - - push - - custom + image: docker:20.10 + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker build -t gitea.allowlgroup.ru/allowlgroup/gptchat:latest . + - docker save gitea.allowlgroup.ru/allowlgroup/gptchat:latest -o gptchat.tar +- name: deploy + + image: appleboy/drone-ssh + settings: + host: gitea.allowlgroup.ru # адрес сервера (если Drone на том же сервере, можно localhost или IP) + username: + from_secret: ssh_username + password: + from_secret: ssh_password + port: 22 + commands: + - scp gptchat.tar ${{ DRONE_SSH_USERNAME }}@${{ DRONE_SSH_HOST }}:/tmp/gptchat.tar + - ssh ${{ DRONE_SSH_USERNAME }}@${{ DRONE_SSH_HOST }} " + docker load -i /tmp/gptchat.tar && + docker stop gptchat || true && + docker rm gptchat || true && + docker run -d --name gptchat -p 8484:8484 gitea.allowlgroup.ru/allowlgroup/gptchat:latest + " + +volumes: + +- name: dockersock + + host: + path: /var/run/docker.sock