File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ workflows:
1010 jobs :
1111 - build_test
1212
13+ # push new Docker image to Docker Hub
14+ - dockerhub_build_and_push :
15+ requires :
16+ - build_test
17+ filters :
18+ branches :
19+ only :
20+ - master
21+
22+
1323 # push new Docker image to ECS
1424 - aws-ecr/build_and_push_image :
1525 repo : pybot
7888
7989 - store_test_results :
8090 path : test-results
91+
92+ dockerhub_build_and_push :
93+ docker :
94+ - image : circleci/python:3.7.1
95+
96+ steps :
97+ - checkout
98+
99+ - setup_remote_docker :
100+ docker_layer_caching : true
101+
102+ - run :
103+ name : Build and push to DockerHub
104+ command : |
105+ echo ${DOCKER_HUB_PASSWORD} | docker login -u ${DOCKER_HUB_USERNAME} --password-stdin
106+
107+ docker build -f docker/Dockerfile \
108+ -t operationcode/pybot:${CIRCLE_BUILD_NUM} \
109+ -t operationcode/pybot:latest .
110+
111+ docker push operationcode/pybot:latest
112+ docker push operationcode/pybot:${CIRCLE_BUILD_NUM}
You can’t perform that action at this time.
0 commit comments