Skip to content

Send Newsletter

Send Newsletter #124

Workflow file for this run

name: Send Newsletter
on:
schedule:
# Run at 15:00 UTC every day, which is 7:00 AM PST
- cron: '0 15 * * 1-5'
workflow_dispatch: # This allows manual triggering of the workflow
jobs:
run-scheduled-job:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run backend script
run: python3 newsLetter/newsletter.py
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORGANIZATION_ID: ${{ secrets.OPENAI_ORGANIZATION_ID }}
GOOGLE_KEY: ${{ secrets.GOOGLE_KEY }}
EMAIL: ${{ secrets.EMAIL }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
SPREADSHEET_ID: ${{ secrets.SPREADSHEET_ID }}
NEW_SPREADSHEET_ID: ${{ secrets.NEW_SPREADSHEET_ID }}