Scrape and push #289
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 and push | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
scrape: | |
name: Scrape and push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git clone https://${{ secrets.PERSONAL_TOKEN }}@github.com/sk-zk/apple-maps-image-collection.git | |
- name: Install packages | |
run: | | |
cd apple-maps-image-collection | |
pip install -r requirements.txt | |
- name: Scrape | |
run: | | |
cd apple-maps-image-collection | |
rm -rf schedules/* | |
python3 scrape.py | |
- name: Push | |
run: | | |
cd apple-maps-image-collection | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Update schedules" | |
git push |