name: Publish Documentation

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * *'


jobs:
  build:
    name: Publish documentation
    runs-on: ubuntu-latest

    steps:

    - name: Check out sources
      uses: actions/checkout@v3

    - name: Set up JDK 17
      uses: actions/setup-java@v3
      with:
        distribution: 'temurin'
        java-version: 17
        cache: 'maven'

    - name: Setup Graphviz
      uses: ts-graphviz/setup-graphviz@v1

    - name: Deploy documentation
      env:
        ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
        ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
      run: ./mvnw -B clean deploy -Pdocumentation
