diff --git a/.circleci/config.yml b/.circleci/config.yml index c75e11b..6c623db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,11 +43,33 @@ jobs: . venv/bin/activate flask db upgrade flask test + deploy-heroku: + docker: + - image : buildpack-deps:trusty + steps: + - checkout + - run: + name: Deploy main to heroku + command: | + git config --global push.default matching + git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main + - run: + name: Smoke test + command: | + HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/api/articles` + if [ "$HTTPCODE" -ne 200 ];then + echo "heroku app not responding, failing deploy" + exit 1 + fi workflows: build_test_deploy: jobs: - build - - test: - requires: + #- test: + # requires: + # - build + - deploy-heroku: + context: Heroku + requires: - build \ No newline at end of file