scrape news #24662
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
# This is a basic workflow to help you get started with Actions | |
name: scrape news | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
schedule: | |
- cron: '0,15,30,45 12-23 * * *' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Fetch latest data | |
run: python main.py | |
- name: Commit data | |
run: |- | |
if [[ `git status --porcelain` ]]; then | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add -A | |
git commit -m "add latest data" | |
git push | |
fi |