stages:
  - push-image

docker-push:
  image: docker
  services:
    - docker:dind
  stage: push-image
  tags: ['docker']
  only:
    - testing
  before_script:
    - echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
  script:
    - docker build --build-arg REACT_APP_URL=${REACT_APP_URL} -t overflow2019/frontend:test .
    - docker push overflow2019/frontend
  after_script:
    - docker logout
