Workflow level success / failure notifications

Hi community,

I’m sorry if this has been asked before :slight_smile:

We have the following usecase, whenever we deploy a repository, we deploy to 1 or more different ECS Fargate services, depending on the repository usecase. I created the following workflow:

  1. Build - Build docker image and push to ECR.

  2. Deploy Service 1 - Update Service 1 task definition with new image url and update Service 1 ECS service. 

  3. Deploy Service 2 - Update Service 2 task definition with new image url and update Service 2 ECS service. 

Reasoning for seperating it to different jobs is only building and pushing to ECR ones and running each “Deploy Service” job in parallel.

I would like to send a notification to Slack based on the workflow status. I can’t seem to find a way to do it on the workflow level, but only on a job level which means I need another job (“notify slack”) with the following argument:

needs: [build, deploy-service-1, deploy-service-2, ..., deploy-service-x]

This means it will only run when all other jobs have ended but I would like to avoid having to update this job based on the number of “Deploy Service” jobs I have for each repository.

Are there other ways to achieve this? Thank you for any suggestions. :slight_smile:

3 Likes

Sorry to tell you that I could not find another way to complete slack notification at workflow level. The current slack actions all need to add to a job, as you need to run building and pushing to ECR ones and running each “Deploy Service” jobs in parallel, use needs in the job with slack action is not avoidable. 

1 Like