forked from zv0n/lunch-go
CI: deploy only on tag
This commit is contained in:
parent
ca302ed6e3
commit
ed16ea34db
59
.drone.yml
59
.drone.yml
@ -1,19 +1,72 @@
|
||||
---
|
||||
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:
|
||||
- docker build -f Dockerfile .
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: deploy
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: docker
|
||||
- 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:
|
||||
- echo "$DOCKER_USERNAME"
|
||||
- docker login "docker.zvon.tech" --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
|
||||
- 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
|
Loading…
Reference in New Issue
Block a user