stages:
    - test
    - staging
  
test:
  image: python:3.8
  stage: test
  script:
  # this configures Django application to use attached postgres database that is run on `postgres` host
    - cd backend/secfit
    - apt-get update -qy
    - pip install -r requirements.txt

staging:
  type: deploy
  image: ruby
  stage: staging
  script:
    - apt-get update -qy
    - apt-get install -y ruby-dev
    - gem install dpl
    - dpl --provider=heroku --app=secfit-v22-frontend --api-key=$HEROKU_STAGING_API_KEY
    - dpl --provider=heroku --app=secfit-v22-backend --api-key=$HEROKU_STAGING_API_KEY
  only:
    - master
