stages:
  - build
  - deploy

variables:
  DOCKER_TLS_CERTDIR: "/certs"  

build:
  image: docker:24.0.5
  stage: build
  only:
    - main
  services:
    - docker:24.0.5-dind
  script:
    - echo "$CI_REGISTRY_PASSWORD" | docker login registry.remo-liebmann.de -u reguser --password-stdin
    - docker build -t registry.remo-liebmann.de/dc-series-homepage:latest .
    - docker push registry.remo-liebmann.de/dc-series-homepage:latest

deploy:
  image: alpine/curl
  stage: deploy
  only:
    - main
  script:
    - curl --insecure -I -X POST https://192.168.12.21:9443/api/webhooks/de3f7f07-5d57-47f4-9b99-c73672a10e6e