首页 > 解决方案 > Link to a file outside public repository on Github

问题描述

I recently created a webpage using Github pages. Since I don't have a paid account, the repository necessarily needs to be kept public. I'm okay with this, except for some .jpeg files which I would like to store in a different, private repository. When I did this and tried to provide a link to this file on the webpage, it didn't work.

Is there any way to do this?

标签: htmlgithubrepository

解决方案


您可能会考虑一个GitHub Actions,例如Deploy to GitHub Pages,它引入了构建步骤工作流。

该步骤可以具有访问您的私有存储库并获取.jpeg您需要将它们添加到构建的存储库的文件的必要秘密。
但这意味着这些文件将存储在公共存储库的发布分支中。

从公共存储库中,您将无法仅“添加链接”到私有存储库资源,而不以一种或另一种方式嵌入允许您访问所述私有存储库的秘密令牌。


推荐阅读