From c50a7f195aea4ad36f347025e51b709394d8abbd Mon Sep 17 00:00:00 2001 From: gruberdev Date: Thu, 28 Mar 2024 22:43:47 -0300 Subject: [PATCH] Single build unified Taskfile --- tasks/build.yaml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tasks/build.yaml diff --git a/tasks/build.yaml b/tasks/build.yaml new file mode 100644 index 0000000..2e7b152 --- /dev/null +++ b/tasks/build.yaml @@ -0,0 +1,43 @@ +version: '3' + +silent: true + +tasks: + default: + cmds: + - task: go + - task: release + + build: + dir: image + cmds: + - task: go + - | + echo {{.VERSION}} && \ + docker build \ + --build-arg VERSION={{.VERSION}} \ + --platform {{.GAME_ARCH}} \ + -t \ + {{.REGISTRY}}/{{.REGISTRY_USER}}/{{.GAME}}:latest \ + -t \ + {{.REGISTRY}}/{{.REGISTRY_USER}}/{{.GAME}}:{{.VERSION}} . + + go: + dir: image + cmds: + - go mod tidy + + push: + dir: image + cmds: + - | + docker push \ + {{.REGISTRY}}/{{.REGISTRY_USER}}/{{.GAME}}:latest + - | + docker push \ + {{.REGISTRY}}/{{.REGISTRY_USER}}/{{.GAME}}:{{.VERSION}} + + release: + cmds: + - task: build + - task: push