Check for finished Kubernetes deployment

We are using github actions to deploy to a kubernetes cluster.
After the deployment is done and the pods are started we want to some sanity checks.
Atm we are using a wait action, currently set to 120 sec in between those steps because starting up the pods and services takes some time.

We would like to have a more programatic approach for this.

There are options with the kubectl to check for the status like the deployment-status, but what I’m looking for is an action which polls this status and once it has a certain state, outputs a signal which can be used by further actions to act on the finished deployment.

Is someone aware if there are actions which can be used for this?
If not I’m happy for input and will create one for this use case.

Hi @BernhardFuchs,

Glad to see you in Github Community Forum!

I didn’t find exactly matched action but a similar one as below:

    - name: verify deployment
      uses: steebchen/kubectl@master
      env:
        KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
        KUBECTL_VERSION: "1.15"
      with:
        args: '"rollout status deployment/my-app"'

Action link here, it uses args command to output the deployment status, can it be applied to your action as well?
If it doesn’t, it’s recommened to create your own action for your use case.

Regards