bookdown book building fails with GitHub action

I was following a blog post about how to deploy a bookdown book to a netlify site using Github actions. I followed all of the steps, I could successfully push files to my Github repo, and the action got 3.5 minutes in before failing. I'm using the default yaml file (the one you get from typing use_github_action("bookdown.yaml") in studio).

The error message is as follows.

Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
3
  shell: /bin/bash -e {0}
4
  env:
5
    GITHUB_PAT: ***
6
    R_LIBS_USER: /Users/runner/work/_temp/Library
7
    TZ: UTC
8
    _R_CHECK_SYSTEM_CLOCK_: FALSE
9
    NOT_CRAN: true
10
Collecting package metadata (current_repodata.json): ...working... failed
11

12
NotWritableError: The current user does not have write permissions to a required path.
13
  path: /usr/local/miniconda/pkgs/cache/b89cf7bf.json
14
  uid: 501
15
  gid: 20
16

17
If you feel that permissions on this path are set incorrectly, you can manually
18
change them by executing
19

20
  $ sudo chown 501:20 /usr/local/miniconda/pkgs/cache/b89cf7bf.json
21

22
In general, it's not advisable to use 'sudo conda'.
23

24

25
Quitting from lines 64-66 (r_and_python_book.Rmd) 
26
Error: Error: Error 1 occurred creating conda environment r-reticulate
27
Execution halted
28
Error: Process completed with exit code 1.

Here is the full bookdown.yaml file:

on:
  push:
    branches:
      - main
      - master

name: bookdown

jobs:
  build:
    runs-on: macOS-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Setup R
        uses: r-lib/actions/setup-r@v1

      - name: Install pandoc
        run: |
          brew install pandoc

      - name: Cache Renv packages
        uses: actions/cache@v2
        with:
          path: $HOME/.local/share/renv
          key: r-${{ hashFiles('renv.lock') }}
          restore-keys: r-

      - name: Cache bookdown results
        uses: actions/cache@v2
        with:
          path: _bookdown_files
          key: bookdown-${{ hashFiles('**/*Rmd') }}
          restore-keys: bookdown-

      - name: Install packages
        run: |
          R -e 'install.packages("renv")'
          R -e 'renv::restore()'

      - name: Build site
        run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
      
      - name: Install npm
        uses: actions/setup-node@v1

      - name: Deploy to Netlify
        # NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        run: |
          npm install netlify-cli -g
          netlify deploy --prod --dir _book

A poster of this thread mentions that all he had to do was install the development version of reticulate, and it was fixed. I'm not sure how to do this with renv, though.

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.