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