Skip to content

sitemap_scraping

sitemap_scraping #770

Workflow file for this run

name: sitemap_scraping
# Controls when the action will run.
on:
schedule:
- cron: '0 01 * * *'
jobs:
autoscrape:
# The type of runner that the job will run on
runs-on: macOS-latest
# Load repo and install R
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
# Set-up R
- name: Install packages
run: |
R -e 'install.packages("tidyverse")'
R -e 'install.packages("rvest")'
R -e 'install.packages("rmarkdown")'
# Run R script
- name: Scrape
run: |
Rscript script.R
Rscript -e 'rmarkdown::render("report.Rmd", output_format = "all")'
# Add new files in data folder, commit along with other modified files, push
- name: Commit files
run: |
git config --local user.name actions-user
git config --local user.email "[email protected]"
git add data/*
git add *
git commit -am "GH ACTION Headlines $(date)"
git push origin main
env:
REPO_KEY: ${{secrets.GITHUB_TOKEN}}
username: github-actions