From 9654fb017d6f68354ce7ffeb00a827487c86fec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 25 Jan 2023 11:36:34 +0100 Subject: [PATCH] Separate Docker container by branch --- .drone.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index d7348ee..128a6f7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,15 +11,30 @@ steps: - poetry install - poetry env info - poetry run pytest -- name: build container +- name: build container (prod) image: plugins/docker settings: repo: registry.kucharczyk.xyz/timetracker tags: - latest + when: + branch: + - main + +- name: build container (non-prod) + image: plugins/docker + settings: + repo: registry.kucharczyk.xyz/timetracker + tags: + - ${DRONE_COMMIT_REF} + - ${DRONE_COMMIT_BRANCH} + when: + branch: + exclude: + - main + + trigger: event: - push - - cron - exclude: - - pull_request \ No newline at end of file + - cron \ No newline at end of file