41 lines
No EOL
1 KiB
YAML
41 lines
No EOL
1 KiB
YAML
steps:
|
|
- name: build-binary
|
|
image: golang:1.24.2
|
|
commands:
|
|
- export CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHA:0:10}
|
|
- go build -ldflags="-X main.CommitSHA=${CI_COMMIT_SHORT_SHA}" -o linux-amd64 .
|
|
when:
|
|
- event: [push, cron]
|
|
branch: [main, develop]
|
|
|
|
- name: build-and-push-docker
|
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
|
settings:
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm64/v8
|
|
repo: git.hackmi.ch/phil/goshorly
|
|
registry: git.hackmi.ch
|
|
tags: latest
|
|
username:
|
|
from_secret: reg-user
|
|
password:
|
|
from_secret: reg-pass
|
|
build_args:
|
|
- CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
|
- CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHA:0:10}
|
|
depends_on:
|
|
- build-binary
|
|
when:
|
|
- event: [push, cron]
|
|
branch: main
|
|
|
|
services:
|
|
docker-daemon:
|
|
image: docker:28.0-dind
|
|
commands:
|
|
- dockerd --tls=false --host=tcp://0.0.0.0:2376
|
|
privileged: true
|
|
when:
|
|
- event: [push, cron]
|
|
|
|
depends_on:
|
|
- 0-pre |