39 lines
815 B
YAML
39 lines
815 B
YAML
type: docker
|
|
kind: pipeline
|
|
name: unit
|
|
|
|
steps:
|
|
# -------------------- tests (host arch only) --------------------
|
|
- name: test
|
|
image: golang:1.22-alpine
|
|
pull: if-not-exists
|
|
commands:
|
|
- go test ./...
|
|
|
|
# -------------------- build + push multi-arch image --------------------
|
|
- name: publish
|
|
image: plugins/docker:latest
|
|
settings:
|
|
username:
|
|
from_secret: docker-user
|
|
password:
|
|
from_secret: docker-pw
|
|
repo:
|
|
from_secret: docker-repo
|
|
|
|
# build context & dockerfile
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
|
|
# enable buildx / multi-arch
|
|
buildx: true
|
|
platforms:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
- linux/arm/v7
|
|
|
|
# tags to push (all as a single multi-arch manifest)
|
|
tags:
|
|
- latest
|
|
|