diff --git a/.circleci/config.yml b/.circleci/config.yml index 54ec5d4..adf154e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ orbs: base: dmx-io/base@2.0.88 jobs: - build: + build_and_push: working_directory: /app docker: - image: docker:17.09.0-ce-git @@ -16,7 +16,6 @@ jobs: command: | apk update apk upgrade - apk add --no-cache curl apk add --no-cache make - run: name: Build application Docker image @@ -25,14 +24,14 @@ jobs: - deploy: name: Push Docker image to Docker Hub command: | - docker login -u $DOCKER_USER -p $DOCKER_PASS + make docker-login-ci make docker-tag-ci make docker-push-ci workflows: main: jobs: - - build: + - build_and_push: filters: branches: only: diff --git a/Makefile b/Makefile index f40787b..3d6a170 100644 --- a/Makefile +++ b/Makefile @@ -229,6 +229,12 @@ release: rm -rf dist VERSION=$(VERSION) goreleaser +docker-login: + docker login + +docker-login-ci: + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker-build: docker build --build-arg VERSION=$(VERSION) --build-arg MAINTAINER=$(MAINTAINER) -t cointop/cointop .