pipeline:
  release-latest:
    image: plugins/docker
    settings:
      repo: registry.t-juice.club/plugin-gotify
      registry: registry.t-juice.club
      username: woodpecker
      password: 
        from_secret: registry_password
      tags:
        - latest
        - "${CI_COMMIT_SHA:0:8}"
    when:
      branch: master
      event: push

  release-tagged:
    image: plugins/docker
    settings:
      repo: registry.t-juice.club/plugin-gotify
      registry: registry.t-juice.club
      username: woodpecker
      password: 
        from_secret: registry_password
      tags:
        - "${CI_COMMIT_TAG}"
    when:
      event: [tag]
  
  notify:
    image: registry.t-juice.club/plugin-gotify
    settings:
      gotify_url: https://gotify.t-juice.club
      gotify_token:
        from_secret: gotify_token
      title: plugin-gotify updated
      message: latest update to ${CI_COMMIT_SHA:0:8}
    when:
      branch: master
      event: [push]