name: Deploy manually to test environment

on:
  workflow_dispatch:
    inputs:
      release_version:
        description: 'Custom version'
        required: false
jobs:
  version:
    uses: walt-id/waltid-identity/.github/workflows/version.yml@5eed6553d3d796a4230c0e662d631f428c2c7717
    with:
      preferred: ${{ inputs.release_version }}
  gradle:
    uses: walt-id/waltid-identity/.github/workflows/gradle.yml@82cfef8abfc585a741406a1275a533e9db6619ed
    secrets: inherit
    needs: version
    with:
      version: ${{ needs.version.outputs.release_version }}
  docker-matrix:
    uses: walt-id/waltid-identity/.github/workflows/load-json.yml@70e59bbea44de0b3511bb6bd72faa553e92f7bcf
    with:
      jsonpath: ".github/workflows/data/docker-matrix.json"
  docker:
    uses: walt-id/waltid-identity/.github/workflows/docker.yml@69b0349a4d83b3183475baf7cd512d54f5541af8
    secrets: inherit
    needs: [ version, docker-matrix ]
    with:
      images: ${{ needs.docker-matrix.outputs.json }}s
      version: ${{ needs.version.outputs.release_version }}
      publish: true
  api-docker-matrix:
    uses: walt-id/waltid-identity/.github/workflows/load-json.yml@70e59bbea44de0b3511bb6bd72faa553e92f7bcf
    with:
      jsonpath: ".github/workflows/data/api-docker-matrix.json"
  api-docker:
    uses: walt-id/waltid-identity/.github/workflows/api-docker.yml@563c196ae5dcbfdbaa1cd5d9a08d94efc331fa34
    secrets: inherit
    needs: [ version, api-docker-matrix ]
    with:
      images: ${{ needs.api-docker-matrix.outputs.json }}
      version: ${{ needs.version.outputs.release_version }}
      publish: true
  deploy:
    uses: walt-id/waltid-identity/.github/workflows/deployment.yml@15a7b93ea2349d29459f4c280dcbcabcda1e5a28
    secrets: inherit
    needs: [ version, gradle, docker, api-docker ]
    with:
      version: ${{ needs.version.outputs.release_version }}
  tag:
    uses: walt-id/waltid-identity/.github/workflows/tag.yml@70e59bbea44de0b3511bb6bd72faa553e92f7bcf
    needs: [ version, deploy ]
    with:
      version: ${{ needs.version.outputs.release_version }}