---
### SET IN CI VARIABLES
# variables:
#   VERSION: "1.0.0"
#   IMAGE_NAME: "registry.example.com/stable-diffusion-webui"

stages:
  - build
  - push

build_image:
  stage: build
  script:
    - docker build --build-arg VERSION=${VERSION} -t ${IMAGE_NAME}:${VERSION} .

push_image:
  stage: push
  script:
    - docker push ${IMAGE_NAME}:${VERSION}
    - docker tag ${IMAGE_NAME}:${VERSION} ${IMAGE_NAME}:latest
    - docker push ${IMAGE_NAME}:latest
