Skip to content

NYT report

NYT report #173

Workflow file for this run

name: NYT report
on:
push:
branches: [ main ]
schedule:
- cron: '0 0 * * 1' # This will happen every monday at 00 hours.
jobs:
build:
runs-on: Ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Container
run: docker pull rocker/tidyverse:4.1.0
##################################################################
# YOU ONLY NEED TO CHANGE THIS BIT -------------------------------
- name: Render
env:
NYT_APIKEY: ${{ secrets.NYT_APIKEY }}
run: |
cd 03-nytimes
docker run -v$(pwd):/home/report -w/home/report \
-e NYT_APIKEY=$NYT_APIKEY \
rocker/tidyverse:4.1.0 \
Rscript -e 'install.packages("ggwordcloud");rmarkdown::render("README.Rmd")'
##################################################################
- name: Commit results
run: |
cd 03-nytimes
git add README_files/figure-gfm/*
git add README.md
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git commit -a -m 'Updating the NYT report' || echo Nothing has changed
git push origin || echo "No changes to commit"