stages:
  - build

build:
  stage: build
  services:
    - docker:18.09.6-dind
  before_script:
    - export TAG=${CI_COMMIT_TAG:-latest}
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.e-biz.fr
    - ./build.sh $TAG $CI_REGISTRY_IMAGE
    - docker push $CI_REGISTRY_IMAGE:$TAG
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'