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

Add unbranded pkgdown site for easier access to documentation #75

Open
stephhazlitt opened this issue Sep 14, 2024 · 1 comment
Open
Assignees

Comments

@stephhazlitt
Copy link
Member

Follow same design as bcdata and bcmaps.

@stephhazlitt stephhazlitt changed the title Add simple pkgdown site for easier access to documentation Add unbranded pkgdown site for easier access to documentation Sep 14, 2024
@jonjunduan
Copy link

jonjunduan commented Sep 23, 2024

Still only able to create a static site using "pkgdown::build_site()" and all the static site files are inside the "docs" folder.
And then in repo "setting"

  1. Click on the "Settings" tab near the top of the page.
  2. In the left sidebar, scroll down and click on "Pages" under the "Code and automation" section.
  3. In the "Build and deployment" section, you'll see a "Source" dropdown menu.
  4. Click on the dropdown and select "Deploy from a branch".
  5. In the "Branch" section, select "this_branch" from the branch dropdown menu.
  6. For the folder, select "/docs" unless you have a specific folder you want to use.
  7. Click the "Save" button.

I had tried the regular method:

  1. Create a new file in your package repository at .github/workflows/pkgdown.yaml.
    a. use the basic setting which is the same as https://github.com/bcgov/bcdata/blob/main/.github/workflows/pkgdown.yaml.
    b. it fails in this step:
      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::pkgdown, local::.
          needs: website

The errors are that it fails to build bcgovr package:

Packaging bcgovr 1.0.5.9999Packaged bcgovr 1.0.5.9999 (1.1s)
  ℹ Building bcgovr 1.0.5.9999Failed to build bcgovr 1.0.5.9999 (1.3s)
  Error: 
  ! error in pak subprocess
  Caused by error in `stop_task_build(state, worker)`:
  ! Failed to build source package bcgovr.
  Full installation output:
  * installing *source* packagebcgovr...
  staged installation is only possible with locking
  ** using non-staged installation
  ** R
  ** inst
  ** byte-compile and prepare package for lazy loadingGitHub host: "https://github.com/"Personal access token for "https://github.com/": <discovered>Can't get user information for this token.
  ℹ GitHub API error (403): Resource not accessible by integration
  ☐ Call `gitcreds::gitcreds_set()` to register this token in the local Git
    credential store.
  ! On Linux, it can be tricky to store credentials persistently.
  ℹ Read more in the 'Managing Git(Hub) Credentials' article
    (<https://usethis.r-lib.org/articles/articles/git-credentials.html>).
  ℹ It is also a great idea to store this token in any password-management
    software that you use.
  ☐ Open URL
    <https://github.com/settings/tokens/new?scopes=repo,user,gist,workflow&description=DESCRIBE
    THE TOKEN'S USE CASE>.
  Error in throw(new_error("gitcreds_not_interactive_error", message = "`gitcreds_set()` only works in interactive sessions")) : 
    `gitcreds_set()` only works in interactive sessions
  Error: Error: unable to load R code in packagebcgovrExecution halted
  ERROR: lazy loading failed for packagebcgovr* removing/tmp/RtmpKZ37aP/pkg-lib12af7c7ef7bc/bcgovr---
  Backtrace:
  1. pak::lockfile_install(".github/pkg.lock")
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)
  ---
  Subprocess backtrace:
   1. base::withCallingHandlers(cli_message = function(msg) { …
   2. get("lockfile_install_internal", asNamespace("pak"))(...)
   3. plan$install()
   4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
   5. base::withCallingHandlers({ …
   6. pkgdepends:::handle_events(state, events)
   7. pkgdepends:::handle_event(state, i)
   8. pkgdepends:::stop_task(state, worker)
   9. pkgdepends:::stop_task_build(state, worker)
  10. base::throw(pkg_error("Failed to build source package {.pkg {pkg}}.", …
  11. | base::signalCondition(cond)
  12. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.

This step is necessary since the next step: "Build site" will need the package "bcgovr" to create the documents.

If we can solve this problem, we can make it work.

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

No branches or pull requests

2 participants