Skip to content

.github/workflows/scrape_news_api_UX.yml #1369

.github/workflows/scrape_news_api_UX.yml

.github/workflows/scrape_news_api_UX.yml #1369

name: Scrape and Update News UX
#on:
#- workflow_dispatch
#schedule:
#- cron: '*/30 * * * *' # Runs every 30 minutes
on:
schedule:
- cron: '0 */4 * * *' # Runs every 4 hours
jobs:
scrape_and_update:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Scrape news and update README
env:
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
run: python ./scripts/scrape_news_api_UX.py
- name: Commit and Push
run: |
git config --global user.name 'aryashah2k'
git config --global user.email '[email protected]'
git add README.md
git commit -m "Update news README"
git push