Skip to content

Commit

Permalink
fix : fix CI discord notification error
Browse files Browse the repository at this point in the history
  • Loading branch information
SolfE committed Sep 26, 2024
1 parent d129612 commit 56973eb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ jobs:
result:
name: Send notification
needs: [build, deploy]
runs-on: ubuntu-latest
steps:
- name: Send Discord notification
if: ${{ job.status }}
- name: Send Discord notification on success
if: ${{ needs.build.result == 'success' && needs.deploy.result == 'success' }}
run: |
if [ "${{ job.status }}" == "success" ]; then
curl -X POST -H "Content-Type: application/json" -d '{"content": "✅ : Deployment to AWS ECS was successful!"}' ${{ secrets.DISCORD_WEBHOOK_URL }}
else
curl -X POST -H "Content-Type: application/json" -d '{"content": "❌ : Deployment to AWS ECS failed!"}' ${{ secrets.DISCORD_WEBHOOK_URL }}
fi
curl -X POST -H "Content-Type: application/json" -d '{"content": "✅ : Deployment to AWS ECS was successful!"}' ${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Send Discord notification on failure
if: ${{ needs.build.result != 'success' || needs.deploy.result != 'success' }}
run: |
curl -X POST -H "Content-Type: application/json" -d '{"content": "❌ : Deployment to AWS ECS failed!"}' ${{ secrets.DISCORD_WEBHOOK_URL }}

0 comments on commit 56973eb

Please sign in to comment.