# Configure CircleCI version: 2 jobs: build: docker: - image: 17.07.0-ce-git steps: - checkout - setup_remote_docker: docker_layer_caching: true - run: command: docker build -t adferrand/backuppc:${CIRCLE_TAG} . - run: command: | mkdir -p workspace docker save adferrand/backuppc:${CIRCLE_TAG} > workspace/docker-backuppc.tar - persist_to_workspace: root: workspace paths: - docker-backuppc.tar deploy: docker: - image: 17.07.0-ce-git steps: - attach_workspace: at: /tmp/workspace - setup_remote_docker: docker_layer_caching: true - run: command: docker load < /tmp/workspace/docker-backuppc.tar - run: command: docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} - deploy: command: docker push adferrand/backuppc:${CIRCLE_TAG} workflows: version: 2 build-n-deploy: jobs: - build: filters: tags: only: ^[0-9.]+ - deploy: requires: - build filters: tags: only: ^[0-9.]+