From 96b64d2001cffddbd01d34d4021a03db7ce15b91 Mon Sep 17 00:00:00 2001 From: Morgan Lombard Date: Sun, 17 Jan 2021 18:18:44 +0100 Subject: [PATCH] :construction_worker: adding heroku deployment --- .circleci/config.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cb1091..94bbf42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,6 +98,23 @@ jobs: docker push $IMAGE_NAME:$CIRCLE_BUILD_NUM docker push $IMAGE_NAME:latest + back-deploy-heroku: + docker: + - image: buildpack-deps:trusty + steps: + - checkout + - run: + name: Heroku Deploy + command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:main + - run: + name: Smoke Test + command: |- + HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/` + if [ "$HTTPCODE" -ne 200 ];then + echo "heroku app not responding, failing deploy" + exit 1 + fi + workflows: version: 2 build-test-back-and-db: @@ -110,3 +127,7 @@ workflows: requires: - initial-build - setup-and-test-db + - back-deploy-heroku: + requires: + - initial-build + - setup-and-test-db