Build single path with dependancies

What is the best way to build a single path based of a larger project. I need to build a single page /foo on my site to a folder with all resources. My goal is to be able to export this page to a github pages repo when needed but not open source the rest of the site.

The advantage would here would be to keep footer, header, and rest of my styles under my site’s private repo and have the required page be listed at the root of the build folder

This doesn’t seem like a Middleman issue. You could probably use .git-ignore file to commit only this specific foo page. See this question: https://stackoverflow.com/questions/1279533/is-there-a-way-to-tell-git-to-only-include-certain-files-instead-of-ignoring-cer