Creation of CSV #464
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: Creation of CSV | |
# Controls when the action will run. | |
on: | |
push: | |
branches: main | |
paths: | |
- 'translation_status.R' | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
Messages: | |
# The type of runner that the job will run on | |
runs-on: macos-latest | |
# Load repo and install R | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: r-devel/r-svn | |
path: r-svn | |
- uses: r-lib/actions/setup-r@v2 | |
- name: Install packages | |
run: | | |
R -e 'install.packages("ISOcodes")' | |
R -e 'install.packages("dplyr")' | |
R -e 'install.packages("purrr")' | |
R -e 'install.packages("readr")' | |
R -e 'install.packages("tidyr")' | |
R -e 'install.packages("utf8")' | |
R -e 'install.packages("withr")' | |
R -e 'install.packages("stringr")' | |
# Run R script | |
- name: Scrape | |
run: Rscript translation_status.R | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Fetch and Merge Changes | |
run: | | |
git fetch | |
git merge origin/main | |
- name: Commit and Push Changes | |
run: | | |
git pull origin main | |
git add *.csv | |
git commit -m "Added csv in the repository" | |
git push |