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

Host docs here instead of ctsm-docs #2839

Open
1 task
samsrabin opened this issue Oct 18, 2024 Discussed in #2819 · 1 comment
Open
1 task

Host docs here instead of ctsm-docs #2839

samsrabin opened this issue Oct 18, 2024 Discussed in #2819 · 1 comment
Assignees
Labels
documentation additions or edits to user-facing documentation

Comments

@samsrabin
Copy link
Collaborator

samsrabin commented Oct 18, 2024

It should be possible without bloating clones; see discussion linked below. I have a proof-of-concept here, which uses this workflow. As of 11fdc30, that workflow runs (a) on a push to main or (b) manually via the Actions tab.

  • Figure out how to generate different versions for ctsm5.0 vs. master. I think this might be helpful.

Discussed in #2819

Originally posted by samsrabin October 7, 2024
CIME is able to generate documentation previews on PRs and automatically update their documentation upon pushes to master because they host their docs in the same repo as their code. Our use of the separate ctsm-docs repo makes this impossible (or at least difficult enough that I can't figure it out given my lack of Github workflow experience).

@samsrabin samsrabin added the documentation additions or edits to user-facing documentation label Oct 18, 2024
@samsrabin samsrabin added this to the ctsm6.0.0 (code freeze) milestone Oct 18, 2024
@samsrabin samsrabin self-assigned this Oct 18, 2024
@samsrabin
Copy link
Collaborator Author

samsrabin commented Oct 18, 2024

I think that link is actually not helpful after all. The issue is that we're talking about generating docs with different versions of the repo itself; I don't think there's a way to handle that in a workflow run.

So as I see it now, there are two options.

Option 1: Host here

  1. Generate a .zip file with the HTML (i.e., html/ directory) for the preserved release version of the website (at the moment, that's release-clm5.0). Upload that (with git lfs) to this repo.
  2. Change the workflow's "Build Sphinx docs with makefile" step so that after building the current docs to ${PWD}/_build/html, it does:
# Create directory structure we need
build_dir=${PWD}/_build
mkdir -p $build_dir/versions/master
mkdir -p $build_dir/versions/release-clm5.0

# Move the current docs build to that structure
mv $build_dir/html $build_dir/versions/master/

# Unzip the release-clm5.0 build to that structure
unzip release-clm5.0.zip -d $build_dir/versions/release-clm5.0/
  1. Change the workflow's "Upload artifact" step to use path: $build_dir/versions.

Pros

  • Keeping everything within this repo is neat and tidy.

Cons

  • Every clone would see the release-clm5.0 .zip file, even if they didn't actually download it. This would inflate the size of fresh clones to some extent, more so whenever that .zip file is changed.
  • Would need to set up a redirect (hopefully automatic? maybe manual) for when people go to the ctsm-docs publish url (https://escomp.github.io/ctsm-docs).
  • I'm not sure this would even work.

Option 2: Keep hosting at ctsm-docs

It should be possible to set up a workflow in the ctsm-docs repo that could build and publish the latest documentation at a regular interval (e.g., nightly). It would do this by checking out the latest master tag from that repo and building that, then the latest on a new release-clm5.0-docs branch and building that. The uploaded artifact would have both (see step 3 of Option 1 above).

Pros

  • Zero risk of inflating the size of fresh clones of the CTSM repo.

Cons

  • A bit convoluted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation additions or edits to user-facing documentation
Projects
None yet
Development

No branches or pull requests

1 participant