lunch-go/.drone.yml
zvon e92675574a
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
CI: wait for docker on deploy
2023-08-25 14:03:39 +02:00

77 lines
1.3 KiB
YAML

---
kind: pipeline
type: kubernetes
name: build
platform:
os: linux
arch: amd64
steps:
- name: formatting-check
image: golang
commands:
- test -z $(gofmt -l .)
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run
commands:
- while [ ! -S "/var/run/docker.sock" ] ; do sleep 1s ; done
- docker build -f Dockerfile .
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
trigger:
event:
- push
---
kind: pipeline
type: kubernetes
name: deploy
platform:
os: linux
arch: amd64
steps:
- name: deploy
image: docker:dind
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
volumes:
- name: dockersock
path: /var/run
commands:
- while [ ! -S "/var/run/docker.sock" ] ; do sleep 1s ; done
- docker login "docker.zvon.tech" --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- docker buildx create --use
- docker buildx build -f Dockerfile -t "docker.zvon.tech/lunch-go:${DRONE_TAG}" --platform linux/amd64,linux/arm64 --push .
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
trigger:
event:
- tag