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 90dafd5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/control-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ 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 +42,15 @@ 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
12 changes: 12 additions & 0 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ 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 90dafd5

Please sign in to comment.