when:
  - event: push

steps:
  - name: build
    image: eclipse-temurin:21-jdk-alpine
    commands:
      - ./mvnw clean package

  - name: notify
    image: deblan/woodpecker-email
    settings:
      debug: true
      dsn:
        from_secret: smtp_url
      from:
        address:
          from_secret: email_sender
        name: "Woodpecker CI"
      recipients_only: true
      recipients:
        from_secret: email_recipient
    when:
      status:
        - failure