I'm new to GitHub actions and am trying to use if for my first automation. I've got an RMD which works on Windows, an renv lockfile with all my packages in and a yaml - see below:
on:
schedule:
- cron: "35 14 */1 * *" # Every two days at 12:13 AM
jobs:
render-rmarkdown:
runs-on: ubuntu-latest
# optionally use a convenient Ubuntu LTS + DVC + CML image
#container: docker://dvcorg/cml:latest
steps:
- uses: actions/checkout@v3
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Setup dependencies
run: |
R -e 'install.packages("remotes")'
R -e 'library(remotes)'
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- name: Setup Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup renv
uses: r-lib/actions/setup-renv@v2
- name: Identify and email
#env:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
Rscript -e 'rmarkdown::render(input = "My_Markdown.Rmd")'
if [[ "$(git status --porcelain)" != "" ]]; then
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add *
git commit -m "Auto update Report"
git push origin
fi
I've had so many problems getting this running and been on various help forums and was hoping I was almost there - but I'm now getting the error install of package 'curl' failed [error code 1] As you can see from the yaml, I found this thread on here and followed the advice to change the yaml - but its still not working. Any help would be much appreciated, it's driving me insane!