before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

php-7.0:
  stage: build
  script:
    - docker build --pull --build-arg PHP_VERSION=7.0 -t $CI_REGISTRY_IMAGE:php-7.0 .
    - docker push $CI_REGISTRY_IMAGE:php-7.0
  only:
    - master

php-7.1:
  stage: build
  script:
    - docker build --pull --build-arg PHP_VERSION=7.1 -t $CI_REGISTRY_IMAGE:php-7.1 .
    - docker push $CI_REGISTRY_IMAGE:php-7.1
  only:
    - master

php-7.2:
  stage: build
  script:
    - docker build --pull --build-arg PHP_VERSION=7.2 -t $CI_REGISTRY_IMAGE:php-7.2 .
    - docker push $CI_REGISTRY_IMAGE:php-7.2
  only:
    - master
