Unable to publish GitHub page for my R package using pkgdown

248 Views Asked by At

I was trying to build a website for my R package using pkgdown R package. FYI, I am not using <username>.github.io.

Following the instrucution (https://pkgdown.r-lib.org/articles/pkgdown.html#publishing), I ran

usethis::use_pkgdown_github_pages()

I have created 'docs' folder and html files in my master branch and an empty 'gh-pages' branch. When I checked locally built pages using pkgdown::build_site(), it works perfect.

However, when I open <username>.github.io/<packagename>, I have 404 error (files not found). Is this because of empty gh-pages branch? Or, is this because I am not using <username>.github.io? The instruction does not provide much, so could you share me any extra documents that explains how to publish a project website on Github using pkgdown?

Thank you!

Sorry for not providing an reproducible example.

I tried re-run

usethis::use_pkgdown_github_pages()

command

commit and push the changes on md files + use pkgdown::build_site() to check locally.

I thought if I made changes on the md files and push the changes to GitHub master branch, pre-setuped bots or codes by use_pkgdown_github_pages() builds and publish the webpage.

1

There are 1 best solutions below

0
On

Just want to update my situation:

I don't know how and why, but 'gh-pages' branch is mirroring the main/document folder for some reason. Github action called "pages build and deployment" ran successfully from mirrored 'gh-pages' branch.