I have two repos that I use GitHub actions to render markdown files into books. Below is the YAML language we use in both repos. When run on one repo, it works fine. When run on the other, it crashes:
build-and-deploy:
runs-on: ubuntu-latest
needs: bookdown
steps:
- name: Checkout
uses: actions/checkout@v4 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Download Artifacts ๐ป # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v1
with:
name: docs
- name: Deploy ๐
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs
TARGET_FOLDER: docs # The folder the action should deploy.
CLEAN: true
PRESERVE: true'
Below are the errors that are generated. Appears to be an issue parsing the YAML header. The YAML header is correct. So, we are looking for ideas on what is wrong. Thank you in advance!
title: "Team PSD Manual"
author: "Team PSD"
date: "r Sys.Date()"
link-citations: yes
preview: yes
site: bookdown::bookdown_site
description: This is the Team PSD one stop shop.
I have not tried to render on my desktop. Not sure how to do that but will figure that out and try it.
Regarding the index.Rmd file that is throwing the parsing error, I have checked, and triple checked the header structure. I have even recreated the file and that has not resolved the error.
The header structure is as follows:
---
title: "Team PSD Manual"
author: "Team PSD"
date: "`r Sys.Date()`"
link-citations: yes
preview: yes
site: bookdown::bookdown_site
description: This is the Team PSD one stop shop.
---
Again, I think the YAML error is in an Rmd file, not in the YAML of the GHA workflow. (If there is an error in the YAML of the workflow, GitHub can't even run it.)
Also, I ran an experiment yesterday where I removed all the content of the index.Rmd file and hand-typed in the YAML header. Still threw the same error 64.
I am not sure what you mean. You need to fix that line I referred to, line 65 in 6.6_produce_patient_and_provider_enrollment_tables_for_progress_reports.md. Add an empty line after the
---
separator line. Plus if you have similar separators elsewhere fix those as well.
In any case, this has nothing to do with GitHub Actions, and I suggest you run bookdown of your laptop locally, it is much simpler to debug it.