mirror of
https://github.com/thelittlerocket/rss-to-email.git
synced 2025-03-01 03:12:56 +08:00
41 lines
1 KiB
YAML
41 lines
1 KiB
YAML
name: Send email
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 * * * *'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
cache: 'npm'
|
|
|
|
- run: npm ci
|
|
- run: npm run email -- actionUrl=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} cron='0 * * * *'
|
|
|
|
- name: File Existence
|
|
id: check_email
|
|
uses: andstor/file-existence-action@v2.0.0
|
|
with:
|
|
files: 'dist/email.html'
|
|
|
|
- name: Send email
|
|
if: steps.check_email.outputs.files_exists == 'true'
|
|
uses: dawidd6/action-send-mail@v3.7.1
|
|
with:
|
|
server_address: smtp.fastmail.com
|
|
server_port: 587
|
|
|
|
username: ${{secrets.MAIL_USERNAME}}
|
|
password: ${{secrets.MAIL_PASSWORD}}
|
|
|
|
subject: RSS to Email
|
|
to: ${{secrets.MAIL_TO}}
|
|
from: ${{secrets.MAIL_USERNAME}}
|
|
|
|
html_body: file://dist/email.html
|