Daily link-history email #671
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
name: Daily link-history email | |
on: | |
workflow_dispatch: # Enable manual invocation for testing | |
schedule: | |
- cron: "0 20 * * *" # 6am daily (AEST) | |
jobs: | |
Send-Email: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- uses: syphar/restore-virtualenv@v1 | |
id: cache-virtualenv | |
with: | |
custom_cache_key_element: ${{ secrets.venv_cachebuster }} | |
- uses: syphar/restore-pip-download-cache@v1 | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
- run: pip install -r requirements.txt | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
- run: pip freeze | |
- run: python daily_pinboard.py | |
env: | |
API_ENDPOINT: ${{ secrets.API_ENDPOINT }} | |
PINBOARD_TOKEN: ${{ secrets.PINBOARD_TOKEN }} | |
EMAIL: ${{ secrets.EMAIL }} | |
- uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: ${{ secrets.SMTP_SERVER }} | |
server_port: 465 | |
username: ${{ secrets.SMTP_USERNAME }} | |
password: ${{ secrets.SMTP_PASSWORD }} | |
subject: "Your Pinboard Daily 5" | |
html_body: file://email.html | |
from: ${{ secrets.EMAIL }} | |
to: ${{ secrets.EMAIL }} |