iwilldie/.drone.yml
Janic Voser 83694d2a67
Some checks failed
continuous-integration/drone/push Build is failing
test
2023-03-11 00:51:24 +01:00

90 lines
1.5 KiB
YAML

kind: pipeline
type: docker
name: default
trigger:
branch:
- main
platform:
os: linux
arch: amd64
steps:
# Run go tests
- name: go-test
image: golang
volumes:
- name: deps
path: /go
commands:
- cd src
- go test
# Build go binaries
- name: go-build-bin-amd64
image: golang
volumes:
- name: deps
path: /go
- name: binaries
path: /binaries
commands:
- cd src
- go build -o /binaries/app
depends_on:
- go-test
# Build Containers for each architecture
- name: docker-build-image-amd64
image: thegeeklab/drone-docker-buildx
volumes:
- name: docker_socket
path: /var/run/docker.sock
- name: binaries
path: /binaries
privileged: true
commands:
settings:
username:
from_secret: gitea_username
password:
from_secret: gitea_password
repo: gitea.voser.cloud/container/iwilldie
registry: https://gitea.voser.cloud
tags:
- ${DRONE_COMMIT_BRANCH}
- latest
platforms: linux/amd64
dockerfile: ./Docker/Dockerfile.amd64
nocache: true
depends_on:
- "go-build-bin-amd64"
# Run go tests
- name: binary-cleanup
image: alpine:latest
volumes:
- name: binaries
path: /binaries
commands:
- rm -rf /binaries/*
when:
status:
- failure
- success
depends_on:
- "go-build-bin-amd64"
- docker-build-image-amd64
# Volumes to mount between steps
volumes:
- name: deps
temp: {}
- name: binaries
temp: {}
- name: docker_socket
host:
path: /var/run/docker.sock