Browse Source

👷 Add heroku deploy step

Add heroku backend deploy step in ci
pull/2/head
Anatole-DC 4 years ago
parent
commit
d33b23d4ce
  1. 27
      .circleci/config.yml

27
.circleci/config.yml

@ -54,6 +54,23 @@ jobs:
environment: environment:
DATABASE_URL: postgres://$PG_USER:$PG_PASSWORD@localhost:5432/$PG_USER 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: workflows:
version: 2 version: 2
build-test-and-lint: build-test-and-lint:
@ -67,4 +84,12 @@ workflows:
- build - build
- back-test-e2e: - back-test-e2e:
requires: requires:
- build
- build
- back-deploy-heroku:
requires:
- build
- lint
- back-test-unit
filters:
branches:
only: main
Loading…
Cancel
Save