Skip to content

Commit

Permalink
wip: Add support for sending email on instance created, started or st…
Browse files Browse the repository at this point in the history
…opped

App password created using https://myaccount.google.com/apppasswords
  • Loading branch information
jcfr committed Apr 18, 2024
1 parent 98f35fa commit a9817e1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/control-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ jobs:
env:
NUMBER: ${{ github.event.issue.number }}
- name: Send mail
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
from: MorphoCloudPortal
subject:
"[MorphoCloudPortal] Instance ${{ github.event.issue.number }}
started"
body: Instance ${{ github.event.issue.number }} started

stop:
runs-on: self-hosted
if:
Expand All @@ -30,3 +44,17 @@ jobs:
echo Stopping instance associated with issue $NUMBER
env:
NUMBER: ${{ github.event.issue.number }}
- name: Send mail
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
from: MorphoCloudPortal
subject:
"[MorphoCloudPortal] Instance ${{ github.event.issue.number }}
stopped"
body: Instance ${{ github.event.issue.number }} stopped
14 changes: 14 additions & 0 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,17 @@ jobs:
echo Creating instance associated with issue $NUMBER
env:
NUMBER: ${{ github.event.issue.number }}
- name: Send mail
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
with:
server_address: smtp.gmail.com
server_port: 465
secure: true
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
from: MorphoCloudPortal
subject:
"[MorphoCloudPortal] Instance ${{ github.event.issue.number }}
created"
body: Instance ${{ github.event.issue.number }} created

0 comments on commit a9817e1

Please sign in to comment.