diff --git a/.travis.yml b/.travis.yml index 75a0712..e16c30f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,16 +13,13 @@ jobs: name: "Unit Tests" script: go test -v ./... - stage: "Build Docker Image" - name: "Build docker image" - script: docker build -t jaskaransarkaria/timer-server:"${TRAVIS_TAG}" . - - stage: - name: "Push Docker Image" + name: "Build and Push docker image" script: | + docker build -t jaskaransarkaria/timer-server:"$TRAVIS_TAG" . echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push jaskaransarkaria/timer-server:"${TRAVIS_TAG}" + docker push jaskaransarkaria/timer-server:"$TRAVIS_TAG" stages: - Tests and Linting - - name: "Build Docker Image" + - name: "Build and Push Docker Image" if: tag IS present - - "Push Docker Image"