diff --git a/.circleci/config.yml b/.circleci/config.yml index e08dea3..d09c3ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,6 +54,23 @@ jobs: environment: DATABASE_URL: postgres://$PG_USER:$PG_PASSWORD@localhost:5432/$PG_USER + 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-and-lint: @@ -67,4 +84,12 @@ workflows: - build - back-test-e2e: requires: - - build \ No newline at end of file + - build + - back-deploy-heroku: + requires: + - build + - lint + - back-test-unit + filters: + branches: + only: main \ No newline at end of file