variables:
  REGISTRY: registry.sc07.dev
  IMAGE_NAME: sc07/canvas:edge

publish:
  stage: publish
  tags:
    - red
  rules:
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  before_script:
    - echo $PAT | docker login $REGISTRY -u $GITLAB_USER_LOGIN --password-stdin
  script:
    - docker build . --tag $REGISTRY/$IMAGE_NAME
    - docker push $REGISTRY/$IMAGE_NAME

deploy:
  stage: deploy
  tags:
    - red
  rules:
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  script:
    - cd $WORK_DIR
    - docker compose pull
    - docker compose up -d
