Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to publish a repo that is (currently) in a private Github Repo #253

Open
Jo-Schie opened this issue Jun 28, 2021 · 5 comments
Open
Labels

Comments

@Jo-Schie
Copy link

I would like to know if there is any experience on publishing a repo with workflowr that is currently private. By publication, I mean really making it publicly available. In that sense the repo would be still private but the rendered report would be somewhere available (ideally github pages). I saw your Q&As about that topic, but actually they do not cover my request since they are only about making a report private.

You may ask why I do not simply make the repo public, but currently I am not able to do that because of company restrictions. The code needs to reviewed first before going public, etc.. Nevertheless, I would like to be able to show people the progress on our repo in user-frindly way. Is that somehow possible?

@pcarbo
Copy link
Member

pcarbo commented Jun 28, 2021

@Jo-Schie I believe GitHub allows users to activate GitHub Pages for private repositories (it may require upgrading your account).

@jdblischak
Copy link
Member

@Jo-Schie Thanks for the question. You want a private repo with a publicly accessible site, correct? If yes, then @pcarbo is right.

Some more context: Years ago when we first started workflowr, GitHub Pages was available for free for both public and private repos, with the caveat that the site was always public (regardless of the status of the repo). At some point this changed, and now GitHub Pages is only free for public repos. If you want to host a site from a private repo, you'll have to upgrade to the $5/month PRO/Team plan. Below is some documentation on the current status:

https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages
https://github.com/pricing#compare-features
https://github.community/t/publish-with-github-pages-keeping-repo-as-private-on-free-plan/10574

GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

Another option to consider is GitLab and GitLab Pages. You can host website in a private repo for free. And you can also control access to the website if you wanted (which you can't do with GitHub Pages, even with a paid plan).

https://docs.gitlab.com/ee/user/project/pages/

@Jo-Schie
Copy link
Author

Thanks @pcarbo and @jdblischak for your responses. I'm currently trying with gitlab. Downside is that I always have to recreate the repo as soon as something changes but I guess for testing purposes that is still doable. But just to understand you correctly. There is not the option to e.g. create another (public) repo where I just push all the workflowr content (i.e. the rendered documents) and then just publish via that (alternative repo)?

@pcarbo
Copy link
Member

pcarbo commented Jun 30, 2021

That is an interesting suggestion. You could do that, although as far as I know there is no convenient function in workflowr that will do that for you.

@jdblischak
Copy link
Member

There is not the option to e.g. create another (public) repo where I just push all the workflowr content (i.e. the rendered documents) and then just publish via that (alternative repo)?

Pushing only the rendered content would be awkward. But if you push the entire repo contents to both GitHub and GitLab, then it would be much simpler.

Here's my suggested setup for hosting the repo at both GitHub and GitLab, but hosting the site with GitLab Pages:

  1. Change the name of the GitHub remote to "github":

    git remote rename origin github
  2. Configure workflowr to host the site with GitLab. Don't include the navbar link since you don't want to share the source code.

    wflow_use_gitlab("gitlabusername", navbar_link = FALSE)
  3. Republish your Rmd files. This will update all the internal links to use GitLab.

    wflow_publish(republish = TRUE)
  4. Push your content to both GitHub and GitLab

    # Push to GitHub
    git push github
    # Push to GitLab
    git push origin
  5. Go to the repo on GitLab and configure the access settings to make the source code private and the website public.

Going forward, every time you run wflow_publish(), then you can push to both GitHub and GitLab using the commands above. You could alternatively use wflow_git_push() with the argument remote if you wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants