Generate Post #337
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
# Create a new post | |
name: Generate Post | |
on: | |
schedule: | |
- cron: 15 13 * * 2-6 # run at 9:15am EDT, Tues-Sat | |
workflow_dispatch: | |
jobs: | |
generate_post: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install yfinance requests | |
- name: configure git | |
run: | | |
git config --global user.name MarketBot | |
git config --global user.email [email protected] | |
- name: Make a new post | |
env: | |
GUARDIAN_API_KEY: ${{ secrets.GUARDIAN_API_KEY }} | |
run: | | |
python post_generator.py | |
- name: Push new post | |
run: | | |
git add content/ | |
git commit -m "New post for $(date)" | |
git push |