Scrape #93
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
# Hourly scraping | |
name: Scrape | |
# Controls when the action will run. | |
on: | |
schedule: | |
- cron: "0 12 * * 0" | |
jobs: | |
scrape: | |
# The type of runner that the job will run on | |
runs-on: macos-latest | |
# Load repo and install R | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: '4.2.1' | |
# Set-up R | |
- name: Install packages | |
run: | | |
R -e 'install.packages("tidyverse")' | |
R -e 'install.packages("rvest")' | |
# Run R script | |
- name: Scrape | |
run: Rscript Scraper.R | |
# Add new files in data folder, commit along with other modified files, push. | |
- name: Commit files | |
run: | | |
git config --local user.name github-actions | |
git config --local user.email "[email protected]" | |
git add data/* | |
git commit -am "GH ACTION Autorun $(date)" | |
git push origin main | |
env: | |
REPO_KEY: ${{secrets.GITHUB_TOKEN}} | |
username: github-actions |