diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..63bd41c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,37 @@ +kind: pipeline +name: sdkserver-pipeline +trigger: + branch: + - main + event: + - push + +image_pull_secrets: + - docker_auth_config + +steps: + - name: build + image: golang:1.21.0 + commands: + - go env -w GOPROXY=https://goproxy.cn,direct + - go env -w GOPRIVATE=gitea.dongyoushixian.com + - go mod tidy + - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o sdkserver_linux main.go + - ls -lh sdkserver_linux + - name: deploy + image: drillster/drone-rsync + settings: + hosts: 111.231.64.109 + user: root + key: + from_secret: SSH_KEY + source: ./sdkserver_linux + target: /wwwroot/sdkserver + secrets: [ SSH_KEY ] + script: + - cd /wwwroot/sdkserver/ + - chmod +x sdkserver_linux + - docker-compose restart + - ls -al + when: + status: [ success ]