-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea29345
commit d5a0d8a
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: github pages | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- run: cargo build --release && strip -s target/release/github-action-rss | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: target/release/github-action-rss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import smtplib as SMTP | ||
import os | ||
from email.mime.text import MIMEText | ||
from email.header import Header | ||
|
||
receivers = os.environ['receivers'] | ||
mail_user = os.environ['mail_user'] | ||
|
||
mail_pass = os.environ['mail_pass'] | ||
mail_host = os.environ['mail_host'] | ||
|
||
mail_msg = '' | ||
|
||
with open('./build/index.html') as f: | ||
mail_msg = f.read() | ||
|
||
message = MIMEText(mail_msg, 'html', 'utf-8') | ||
message['From'] = Header(mail_user, 'utf-8') | ||
message['To'] = Header(receivers, 'utf-8') | ||
|
||
subject = 'GitHub Action RSS' | ||
message['Subject'] = Header(subject, 'utf-8') | ||
|
||
|
||
try: | ||
conn = SMTP.SMTP() | ||
conn.set_debuglevel(1) | ||
conn.connect(mail_host) | ||
conn.login(mail_user, mail_pass) | ||
conn.sendmail(mail_user, receivers, message.as_string()) | ||
print('send success!!') | ||
except SMTP.SMTPException: | ||
print('send error!!') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters