diff --git a/build/ci/.drone.yml b/build/ci/.drone.yml index 350c7d7..9bff477 100644 --- a/build/ci/.drone.yml +++ b/build/ci/.drone.yml @@ -15,6 +15,42 @@ steps: image: golang:1.20 commands: - GOOS=linux GOARCH=amd64 go build -o butler cmd/butler/main.go + - touch .env + - echo TELEGRAM_TOKEN=AAAAAAAA >> .env + + - name: copy to server + pull: if-not-exists + image: appleboy/drone-scp + settings: + host: + from_secret: ssh_ip + username: + from_secret: ssh_user + key: + from_secret: ssh_key + port: + from_secret: ssh_port + target: /home/crab/deploys/butler_bot + source: + - .env + - build/ci/Dockerfile + - deploy/docker-compose.yml + - migrations + rm: true + +# - name: deploy +# pull: if-not-exists +# image: appleboy/drone-ssh +# settings: +# host: +# from_secret: ssh_ip +# username: +# from_secret: ssh_user +# key: +# from_secret: ssh_key +# port: +# from_secret: ssh_port +# script: # TODO: # scp bin, Dockerfile, docker-compose diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index a1d06e8..866c737 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,10 +1,9 @@ -version: "3.3" +version: "3.8" services: - butler: container_name: butler - build: - context: ../build/ci - dockerfile: Dockerfile + build: . command: /butler + env_file: + - .env