How to include folders from main repo when serving github pages from /docs?

I’m looking to include some markdown files that are in a folder /foo/bar/file.md from the root of my repo in my GitHub pages Jekyll site. I’ve tried symbolically linking the folder to the right location in /docs/_pages but GitHub gives me the error:

Your site is having problems building: The symbolic link /foo/bar targets a file which does not exist within your site's repository. For more information, see https://docs.github.com/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#symlink-does-not-exist-within-your-sites-repository.

I understand that as my site is being hosted from /docs in my repository, by linking to /foo/bar, I am linking to a file outside the sites folder but how do I include this folder considering that they are in the same repo?

As I wanted to keep my site in the /docs folder I used GitHub actions to copy the relevant files on every push.

As I wanted to keep my site in the /docs folder I used GitHub actions to copy the relevant files on every push.

My prior soultion gave the issue that for every commit I made, an additional commit was made to copy the files into their locations in the /docs folder.

To fix this I linked to the files the other way around. This is to say that I kept my site documents in the /docs folder and linked the contents to folders elsewhere in the repo.

In hindsite this makes much more sense and uses the symbolic links as shortcuts to my messy /docs folder. It also fixes the issue of having multiple commits for a single push.