name: Release

on:
  workflow_dispatch:
  release:
    types: [published]

permissions:
  contents: read
  deployments: write

jobs:
  tests:
     uses: {{& githubSlug}}/.github/workflows/test.yaml@main
     secrets: inherit
{{#hasMta}}
  deploy-cf:
    needs: [tests]
    uses: {{& githubSlug}}/.github/workflows/cf.yaml@main
    secrets: inherit
    with:
      environment: Production
{{/hasMta}}{{^hasMta}}{{#hasKyma}}
  deploy-kyma:
    needs: [tests]
    uses: {{& githubSlug}}/.github/workflows/kyma.yaml@main
    secrets: inherit
    with:
      environment: Production
{{/hasKyma}}{{/hasMta}}
