scrape #7
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: scrape | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' # run at midnight on every Sunday. | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install all necessary packages | |
run: pip install requests pandas tqdm | |
- name: Run the scraping script for metadata | |
run: python src/main.py | |
- name: Commit and push if anything has changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" && | |
export COMMIT_HASH=$(git rev-parse HEAD) || | |
exit 0 | |
git push |