Skip to content

scrape

scrape #20

Workflow file for this run

name: scrape
on: workflow_dispatch
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.10'
- name: Installed package list
run: apt list --installed
- name: Remove Chrome
run: sudo apt purge google-chrome-stable
- name: Remove default Chromium
run: sudo apt purge chromium-browser
- name: Install a new Chromium
run: sudo apt install -y chromium-browser
- name: Install all necessary packages
run: pip install requests beautifulsoup4 pandas selenium titlecase googlemaps webdriver-manager
- name: Run the scraping script
env:
LOCATIONS_FILEPATH: ${{ secrets.LOCATIONS_FILEPATH }}
GMAPS_CACHE_FILEPATH: ${{ secrets.GMAPS_CACHE_FILEPATH }}
GMAPS_API_KEY: ${{ secrets.GMAPS_API_KEY }}
run: python backend/main.py
- name: Commit and push if content changed
run: |-
git fetch
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git checkout pages
git checkout main -- locations.json
git push