name: Restart Classic RT

on:
  workflow_dispatch:
    inputs:
      namespace:
        description: 'Deployment (e.g. dev, uat, demo)'
        required: true
        default: 'demo'

jobs:
  build:
    runs-on: ubuntu-20.04

    steps:
    - name: Checkout code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: Set up Google Cloud
      uses: google-github-actions/setup-gcloud@master
      with:
        version: '285.0.0'
        project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
        service_account_key: ${{ secrets.GOOGLE_SERVICE_KEY }}

    - name: Get GKE credentials
      run: gcloud container clusters get-credentials "${{ secrets.GOOGLE_CLUSTER }}" --zone "${{ secrets.GOOGLE_COMPUTE_ZONE }}"

    - name: Restart deployments
      run: |
        kubectl rollout restart deployments/broker --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/analytics --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/blotter --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/bot --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/client --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/new-client --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/nlp --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/pricehistory --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/pricing --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/referencedataread --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/storybook --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/styleguide --namespace ${{ github.events.inputs.namespace }}
        kubectl rollout restart deployments/tradeexecution --namespace ${{ github.events.inputs.namespace }}

Add manual workflow to restart classic deployments
feat: Add manual workflow to restart classic deployments
