From 7c4ea59e9c450e22672284e3cf0d1cabdf79d63a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 29 Jan 2024 10:19:45 -0800 Subject: [PATCH] adding rocket chat notification Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 35 +++++++++----------- .github/workflows/main.yaml | 1 + 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 224da9ae..ade40426 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -14,14 +14,11 @@ inputs: description: The name of the image in the GHCR to be deployed. required: true image_digest: - description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. + description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. required: true openshift_image_name: description: The name of the image to use when pushing to OpenShift. required: true - service: - description: The name of images used - required: true # OpenShift parameters openshift_server_url: @@ -37,10 +34,10 @@ inputs: description: The token used to authenticate with the OpenShift server. required: true - # rocket.chat notification parameters - # rocketchat_webhook: - # description: The URL to use for posting notifications to rocket.chat. - # required: true + rocket.chat notification parameters + rocketchat_webhook: + description: The URL to use for posting notifications to rocket.chat. + required: true runs: using: composite @@ -87,14 +84,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - # - name: Rocket.Chat Notification - # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - # if: always() - # with: - # type: ${{ job.status }} - # job_name: '*Deployment to ${{ inputs.environment }}*' - # mention: 'here' - # mention_if: 'failure' - # channel: '#test-gha' - # url: ${{ inputs.rocketchat_webhook }} - # commit: true \ No newline at end of file + - name: Rocket.Chat Notification + uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + if: always() + with: + type: ${{ job.status }} + job_name: '*Deployment to ${{ inputs.environment }}*' + mention: 'here' + mention_if: 'failure' + channel: '#ditp-gha-notifications' + url: ${{ inputs.rocketchat_webhook }} + commit: true \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3db8acf4..e36ad53f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -210,6 +210,7 @@ jobs: namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68