This commit is contained in:
@@ -34,21 +34,27 @@ jobs:
|
||||
- name: Clean up old images
|
||||
run: docker image prune -f
|
||||
|
||||
# Email Notification (on success)
|
||||
# Email notification using curl (Gmail SMTP)
|
||||
- name: Send success email
|
||||
if: success()
|
||||
uses: dawidd6/action-send-mail@v3
|
||||
with:
|
||||
server_address: smtp.gmail.com
|
||||
server_port: 587
|
||||
username: ${{ secrets.EMAIL_USERNAME }}
|
||||
password: ${{ secrets.EMAIL_PASSWORD }}
|
||||
subject: '✅ Deployment Successful - rc-portfolio'
|
||||
to: raghu6004@gmail.com
|
||||
from: GitHub Actions
|
||||
body: |
|
||||
Deployment completed successfully!
|
||||
Repository: ${{ github.repository }}
|
||||
Branch: ${{ github.ref }}
|
||||
Commit: ${{ github.sha }}
|
||||
Workflow: ${{ github.workflow }}
|
||||
run: |
|
||||
curl --ssl-reqd \
|
||||
--url "smtps://smtp.gmail.com:465" \
|
||||
--user "${{ secrets.EMAIL_USERNAME }}:${{ secrets.EMAIL_PASSWORD }}" \
|
||||
--mail-from "${{ secrets.EMAIL_USERNAME }}" \
|
||||
--mail-rcpt "raghu6004@gmail.com" \
|
||||
--upload-file - << EOF
|
||||
From: GitHub Actions <${{ secrets.EMAIL_USERNAME }}>
|
||||
To: your-email@example.com
|
||||
Subject: ✅ Deployment Successful - Portfolio
|
||||
|
||||
Deployment completed successfully!
|
||||
|
||||
Repository: ${{ github.repository }}
|
||||
Branch: ${{ github.ref_name }}
|
||||
Commit: ${{ github.sha }}
|
||||
Workflow: ${{ github.workflow }}
|
||||
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
Time: $(date)
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user