image: docker:stable

stages:
  - build
  - portainer
### BUILD
build:
  stage: build
  only:
    - master
    - main
  script:
    - docker build ./ -t "$CI_REGISTRY_IMAGE:latest" --no-cache 
    - docker login $CI_REGISTRY -u $CI_REGISTRY_USER  -p $CI_REGISTRY_PASSWORD
    - docker push "$CI_REGISTRY_IMAGE:latest"
