From b8878ef8bc7738cec9bfcdbb0a63883a49fc640b Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:34:10 +0200 Subject: [PATCH] Add Discord notifications for SDK deployment start and success --- .github/workflows/deploy-sdk-production.yaml | 21 ++++++++++++++++++++ .github/workflows/deploy-sdk-staging.yaml | 11 +++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-sdk-production.yaml b/.github/workflows/deploy-sdk-production.yaml index abff0e43a..c55b9df50 100644 --- a/.github/workflows/deploy-sdk-production.yaml +++ b/.github/workflows/deploy-sdk-production.yaml @@ -38,6 +38,20 @@ jobs: CONFIG_URL: ${{ secrets.CONFIG_URL }} CONFIG_URL_RAYS: ${{ secrets.CONFIG_URL_RAYS }} steps: + - name: Send start notification to Discord + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SDK_DEPLOY }} + DISCORD_EMBEDS: + '[{"title":"Link to GitHub Action: + ${{github.run_id}}","url":"https://github.com/${{github.repository}}/actions/runs/${{github.run_id + }}"}]' + with: + args: + 'SDK deployment `${{github.run_id}}` started on production 🚀 (from branch `${{ + github.ref_name }}` by [${{github.triggering_actor + }}](https://github.com/${{github.triggering_actor }}).' + - name: Git clone the repository uses: actions/checkout@v3 @@ -72,3 +86,10 @@ jobs: - name: Deploy app run: | pnpm run sst:deploy:sdk:prod + + - name: Send success notification to Discord + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SDK_DEPLOY }} + with: + args: 'SDK deployment `${{github.run_id}}` finished successfully on staging 🎉\n ' diff --git a/.github/workflows/deploy-sdk-staging.yaml b/.github/workflows/deploy-sdk-staging.yaml index 217b571d1..972cd5104 100644 --- a/.github/workflows/deploy-sdk-staging.yaml +++ b/.github/workflows/deploy-sdk-staging.yaml @@ -43,13 +43,14 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SDK_DEPLOY }} DISCORD_EMBEDS: - '[{"title":"Link to run: + '[{"title":"Link to GitHub Action: ${{github.run_id}}","url":"https://github.com/${{github.repository}}/actions/runs/${{github.run_id }}"}]' with: args: - 'SDK deployment started on staging 🚀 (from branch `${{ github.ref_name }}` by - [${{github.triggering_actor }}](https://github.com/${{github.triggering_actor }}).' + 'SDK deployment `${{github.run_id}}` started on staging 🚀 (from branch `${{ + github.ref_name }}` by [${{github.triggering_actor + }}](https://github.com/${{github.triggering_actor }}).' - name: Git clone the repository uses: actions/checkout@v3 @@ -92,9 +93,7 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SDK_DEPLOY }} with: - args: - 'SDK deployed successfully on staging 🎉\n (from ${{ github.ref }} by - ${{github.triggering_actor }}).' + args: 'SDK deployment `${{github.run_id}}` finished successfully on staging 🎉\n ' - name: Trigger e2e tests in e2e-tests repository env: