Data Scraping #2
This file contains hidden or 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
# .github/workflows/scraper.yml | |
name: Data Scraping | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # Runs every Sunday at midnight | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Data Scrapers | |
run: | | |
node scraper/regionalDataScraper.js | |
node scraper/populationDataScraper.js | |
node scraper/mergeData.js | |
- name: Commit and Push Changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add data/*.json | |
git commit -m "Automated data update" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.SCRAPER_TOKEN }} |