ci: 添加 Gitea Actions 示例工作流

- 新增 ci.yaml 文件,定义 Gitea Actions 示例
This commit is contained in:
hu xiaotong
2025-07-09 08:02:27 +08:00
parent 06e5c364a8
commit 5ec9843b94

View File

@@ -3,33 +3,13 @@ type: docker
name: default name: default
steps: steps:
- name: restore cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- go/pkg/mod
- ~/.cache/go-build
backend: local
cache_key: go-mod-cache-{{ branch }}
- name: build - name: build
image: golang:1.22 image: golang:1.22
commands: commands:
- go env -w GO111MODULE=on - go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct - go env -w GOPROXY=https://goproxy.cn,direct
- go mod tidy - go mod tidy
- go build -o main.exe . - go build -v -o main main.go
- name: rebuild cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- go/pkg/mod
- ~/.cache/go-build
backend: local
cache_key: go-mod-cache-{{ branch }}
- name: upload - name: upload
image: appleboy/drone-scp image: appleboy/drone-scp
@@ -44,16 +24,13 @@ steps:
- scripts/start.sh - scripts/start.sh
target: /opt/dockeropt/epic-go target: /opt/dockeropt/epic-go
# 可选远程重启服务 - name: restart epic-go container
# - name: restart image: appleboy/ssh
# image: appleboy/ssh settings:
# settings: host: 193.112.151.199
# host: 你的服务器IP或域名 username: root
# username: 你的SSH用户名 password:
# password: from_secret: scp_password
# from_secret: scp_password port: 222
# port: 22 script:
# script: - docker restart epic-go
# - cd /your/deploy/path/
# - chmod +x start.sh
# - ./start.sh