diff --git a/.circleci/config.yml b/.circleci/config.yml index 92340e9..cbe5c98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,6 +45,24 @@ jobs: flask db migrate flask db upgrade flask test + deploy-heroku: + docker: + - image: buildpack-deps:trusty + steps: + - checkout + - run: + name: Déploiement 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: version: 2