feat 添加构建
Some checks failed
Build image / build (push) Failing after 12s

This commit is contained in:
timerzz 2024-08-27 14:23:17 +08:00
parent f1d3daa652
commit c68b166a3f
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,24 @@
name: Build image
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: http://192.168.31.55:13000/timerzz/setup-go@v4
env:
HTTPS_PROXY: http://192.168.31.55:10809
with:
go-version: '1.22.x'
- uses: http://192.168.31.55:13000/timerzz/checkout@v4
- uses: http://192.168.31.55:13000/timerzz/setup-ko@v0.6
with:
version: v0.15.4
env:
KO_DOCKER_REPO: 192.168.31.55:5000/kedaya/provider
HTTP_PROXY: http://192.168.31.55:10809
HTTPS_PROXY: http://192.168.31.55:10809
- run: ko build --bare ./cmd
env:
KO_DOCKER_REPO: 192.168.31.55:5000/kedaya/provider
HTTP_PROXY: http://192.168.31.55:10809
HTTPS_PROXY: http://192.168.31.55:10809

16
.ko.yaml Normal file
View File

@ -0,0 +1,16 @@
defaultPlatforms:
- linux/amd64
defaultBaseImage: alpine:latest
builds:
- id: spider
dir: . # default is .
main: ./cmd
env:
- CGO_ENABLED=0
- GOPROXY=https://goproxy.cn,direct
- GOPRIVATE=gitea.timerzz.com
- GONOSUMDB=gitea.timerzz.com
- GONOPROXY=gitea.timerzz.com
ldflags:
- -s -w
- -extldflags "-static"