From 03de4e8c85f60ca9be1aa8a41a21928697f493ad Mon Sep 17 00:00:00 2001 From: hu xiaotong <416314413@163.com> Date: Wed, 9 Jul 2025 08:03:02 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Gitea=20Actions=20?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ci.yaml 文件,定义 Gitea Actions 示例 --- .drone.yml | 76 ++++++++++++++++++------------------------------------ 1 file changed, 25 insertions(+), 51 deletions(-) diff --git a/.drone.yml b/.drone.yml index e4f8f92..277f43f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,60 +3,34 @@ type: docker name: default steps: - - name: restore cache - image: drillster/drone-volume-cache - volumes: - - name: go-mod-cache - path: /opt/drone/cache/go-mod - - name: go-build-cache - path: /opt/drone/cache/go-build - settings: - restore: true - mount: - - /opt/drone/cache/go-mod - - /opt/drone/cache/go-build - backend: local - cache_key: go-mod-cache-${DRONE_BRANCH} - - name: build image: golang:1.22 commands: - - mkdir -p /opt/drone/cache/go-mod - - echo "drone test" > /opt/drone/cache/go-mod/drone_testfile - - ls -lR /opt/drone/cache/go-mod + - go env -w GO111MODULE=on + - go env -w GOPROXY=https://goproxy.cn,direct + - go mod tidy + - go build -v -o main main.go - - name: rebuild cache - image: drillster/drone-volume-cache - volumes: - - name: go-mod-cache - path: /opt/drone/cache/go-mod - - name: go-build-cache - path: /opt/drone/cache/go-build + - name: upload + image: appleboy/drone-scp settings: - rebuild: true - mount: - - /opt/drone/cache/go-mod - - /opt/drone/cache/go-build - backend: local - cache_key: go-mod-cache-${DRONE_BRANCH} + host: 193.112.151.199 + username: root + password: + from_secret: scp_password + port: 222 + source: + - main.exe + - scripts/start.sh + target: /opt/dockeropt/epic-go - # 可选:远程重启服务 - # - name: restart - # image: appleboy/ssh - # settings: - # host: 你的服务器IP或域名 - # username: 你的SSH用户名 - # password: - # from_secret: scp_password - # port: 22 - # script: - # - cd /your/deploy/path/ - # - chmod +x start.sh - # - ./start.sh -volumes: - - name: go-mod-cache - host: - path: /opt/drone/cache/go-mod - - name: go-build-cache - host: - path: /opt/drone/cache/go-build \ No newline at end of file + - name: restart epic-go container + image: appleboy/ssh + settings: + host: 193.112.151.199 + username: root + password: + from_secret: scp_password + port: 222 + script: + - docker restart epic-go \ No newline at end of file