Skip to content

Commit

Permalink
feat: Adding Notifications as seperate event listener. (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot authored Dec 22, 2023
1 parent 05b5a51 commit b6c22d2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ jobs:
target: ${{ needs.vars.outputs.pr }}
tags: test #Promote images AFTER successful deploy

notify-teams-test:
name: Notify Teams - Test
needs: [deploys-test, vars]
runs-on: ubuntu-22.04
steps:
- name: MS Teams Notifications
uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: Notify QA Team
value: "Successful Deploy of ${{ needs.vars.outputs.pr }} to TEST - cc QA TEAM"
show-on-exit: false

deploys-prod:
name: Deploys (prod)
needs: [promote-images-test, vars]
Expand All @@ -90,21 +75,6 @@ jobs:
vault_role: prod
vault_zone: prod

notify-teams-prod:
name: Notify Teams - Prod
needs: [deploys-prod, vars]
runs-on: ubuntu-22.04
steps:
- name: MS Teams Notifications
uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: Notify Production Team
value: "Successful Deploy of ${{ needs.vars.outputs.pr }} to PROD"
show-on-exit: false

promote-images-prod:
name: Promote Images - Prod
needs: [deploys-prod, vars]
Expand Down Expand Up @@ -197,15 +167,6 @@ jobs:
release_name: Release ${{ needs.GitVersion.outputs.fullSemVer }}
draft: false
prerelease: false
- name: MS Teams Notifications
uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: Notify Teams
value: "Release ${{ needs.GitVersion.outputs.fullSemVer }} Created."
show-on-exit: false

promote-images-release:
name: Tag images with Release Version
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Notifications
on:
pull_request:
types: [opened,reopened,synchronize,closed]
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- 'common/graphics/**'
- '!.github/workflows/deploy.yml'
- '!.github/workflows/merge.yml'
jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
uses: bcgov-nr/[email protected]

notify-teams:
name: Notify Teams
needs: [vars]
runs-on: ubuntu-22.04
steps:
- name: MS Teams Notifications
uses: dchourasia/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ vars.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: PR#
value: "${{ needs.vars.outputs.pr }}"
show-on-exit: false

0 comments on commit b6c22d2

Please sign in to comment.