Build blogdown with github actions in subdir

Hi!

I would like to build a blogdown page with github actions from a subdirectory of the project's repo. I tried to modify the build.yaml created by usethis::use_github_action("blogdown"). The job stops because it does not find the blogdown package, but it is included in the renv.lock file.

I suspect that the error is due to having the whole R project in a subdirectory. I tried to find a path argument for actions/renv to use it with uses/with but I could not find one. Has anyone seen a good solution to this?

Here is my build file:

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
  push:
    branches: [main, master]

name: blogdown

jobs:
  blogdown:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./transparent-psi-site
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2
        with:
          path: ./transparent-psi-site
        
      - uses: r-lib/actions/setup-pandoc@v1

      - uses: r-lib/actions/setup-r@v1
        with:
          use-public-rspm: true

      - uses: r-lib/actions/setup-renv@v1

      - name: Install hugo
        run: |
          R -e 'blogdown::install_hugo()'
      - name: Build site
        run: |
          R -e 'blogdown::build_site(TRUE)'
      - name: Deploy to GitHub pages 🚀
        uses: JamesIves/github-pages-deploy-action@4.1.4
        with:
          branch: gh-pages
          folder: public

This topic was automatically closed 21 days after the last reply. 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.