name: Push pipeline on OpenHEXA

on: 
{%- if workflow_mode == 'release' %}
  release:
    types: [published]

{%- elif workflow_mode == 'push' %}
  push:
    branches:
      - main
{%- elif workflow_mode == 'manual' %}
  workflow_dispatch:
    inputs:
      message:
        description: Commit message
        required: false
{% endif %}

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Push pipeline to OpenHEXA
        uses: blsq/openhexa-push-pipeline-action@v1.0.0
        with:
          token: ${{ secrets.OH_TOKEN }}
          workspace: "[[ workspace_slug ]]"
          pipeline: "[[ pipeline_code ]]"