From 481052006789b06be87601bd876bd65a162ec753 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 26 Oct 2021 11:37:49 +0200 Subject: [PATCH 1/3] :construction_worker: Add Heroku CI conf --- .circleci/config.yml | 30 ++++++++++++++++++++++++++++++ Procfile | 1 + 2 files changed, 31 insertions(+) create mode 100644 Procfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 461688f..928f67b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,6 +102,27 @@ jobs: docker push $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:$CIRCLE_BUILD_NUM docker push $DOCKER_HUB_USER_ID/$DOCKER_HUB_IMAGE:latest + deploy-heroku: + <<: *shared-config + steps: + - setup_dependencies + -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 + + # --- Workflow definition --- # workflows: @@ -127,3 +148,12 @@ workflows: branches: only: - main + - deploy-heroku: + requires: + - test + - test-e2e + - lint +# filters: +# branches: +# only: +# - main diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..36c6b6b --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: yarn start:prod From d962da85d6369a2b37f7c0ff5a909b494756c6e2 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 26 Oct 2021 11:41:03 +0200 Subject: [PATCH 2/3] :pencil2: Fix steps structure --- .circleci/config.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 928f67b..516f499 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,23 +104,25 @@ jobs: deploy-heroku: <<: *shared-config + docker: + - image: buildpack-deps:trusty + auth: + username: *dockerhub-user-id + password: *dockerhub-password steps: + - checkout - setup_dependencies - -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 + - 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 # --- Workflow definition --- # From 53d8bc923c97566a8671fde731117547122f2362 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 26 Oct 2021 11:58:49 +0200 Subject: [PATCH 3/3] :construction_worker: Add branch filters for the deploy heroku step --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 516f499..b76cc54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,7 +155,7 @@ workflows: - test - test-e2e - lint -# filters: -# branches: -# only: -# - main + filters: + branches: + only: + - main