From 5818e932898a5f42ad18586ae63be05d2e49a8b8 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Mon, 16 Jul 2018 22:57:38 +0000 Subject: [PATCH] circleci: Separate build from deploy --- .circleci/config.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 25a327c..7d9071a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,9 +6,6 @@ jobs: environment: - di: "nfpis/nfpis" - dtag: "latest" - - service_name: "nfpis" - - target_port: "7021" # The target port on the docker software - - service_port: "3000" # The exposed public port working_directory: ~/nfpis steps: - run: @@ -24,6 +21,20 @@ jobs: command: | docker login -u $DOCKER_USER -p $DOCKER_PASS docker push ${di} + deploy: + docker: + - image: docker:latest + environment: + - di: "nfpis/nfpis" + - dtag: "latest" + - service_name: "nfpis" + - target_port: "7021" # The public target port on the docker host + - service_port: "3000" # The exposed port on the docker + working_directory: ~/nfpis + steps: + - run: + name: Update and install SSH & Git + command: apk update && apk upgrade && apk add --no-cache bash openssh - deploy: name: Deploy to production command: | @@ -42,3 +53,13 @@ workflows: jobs: - build: context: org-global + filters: + branches: + only: master + - deploy: + context: org-global + requires: + - build + filters: + branches: + only: master