Skip to content

Commit

Permalink
Mic-4384/Notify on workflow failure (#105)
Browse files Browse the repository at this point in the history
Mic-4384/Notify workflow failure

Sends email notification on schedule or deploy workflow failure
- *Category*: CI
- *JIRA issue*: [MIC-4384](https://jira.ihme.washington.edu/browse/MIC-4384)

Changes and notes
-sends email notification when schedule or deploy workflowsfail
  • Loading branch information
albrja committed Oct 24, 2023
1 parent 5d6cc56 commit 874651b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,23 @@ jobs:
- name: Doctest
run: |
make doctest -C docs/
- name: Send mail
# Notify when cron job fails
if: (github.event_name == 'schedule' && failure())
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.NOTIFY_EMAIL }}
password: ${{ secrets.NOTIFY_PASSWORD }}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: uw_ihme_simulationscience@uw.edu
# from email name
from: Vivarium Notifications

20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@ jobs:
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Send mail
# Notify when cron job fails
if: failure()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.NOTIFY_EMAIL }}
password: ${{ secrets.NOTIFY_PASSWORD }}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: uw_ihme_simulationscience@uw.edu
# from email name
from: Vivarium Notifications

0 comments on commit 874651b

Please sign in to comment.