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 netlify integrataion for preview builds on PRs #175

Closed
nickreich opened this issue Jan 30, 2024 · 7 comments · Fixed by #195
Closed

add netlify integrataion for preview builds on PRs #175

nickreich opened this issue Jan 30, 2024 · 7 comments · Fixed by #195
Assignees

Comments

@nickreich
Copy link
Member

No description provided.

@nickreich
Copy link
Member Author

@bsweger I'm "reassigning" this issue to you as we have some planned additions to the website coming up in future weeks (there is one PR that already has a non-trivial organizational change) and it would be really nice to have previews set up for the developers pushing the changes and for reviewers. Hoping that now that we have the netlify stuff set up in a few different places (for free!) that maybe this will not be super hard or long. 🤞

@bsweger
Copy link
Collaborator

bsweger commented Mar 27, 2024

@nickreich Got it! It looks like the reichlab site is currently hosted on GitHub pages, not on Netlify.

Are you asking to:

  • switch the hosting to Netlify?
  • see if there's a way to do a Netlify preview on GitHub pages websites?
  • see if there's non-Netlify way to preview GitHub pages are part of the PR process?
  • do whatever is the most straightforward way to ensure that someone submitting a PR to this repo can preview their changes?

@nickreich
Copy link
Member Author

Basically the fourth bullet point would be fine. I think I was assuming that something like "see if there's a way to do a Netlify preview on GitHub pages websites" would be feasible since I think that is what we have set up with all of the hubverse sites as well? E.g. I don't think any of those sites are hosted on netlify, but the previews are.

@bsweger
Copy link
Collaborator

bsweger commented Mar 28, 2024

Thanks! @matthewcornell helped me confirm that these sites have GitHub pages disabled, so they must be hosted on Netlify.

Which makes sense, given what I see when logging in to Netlify:

image

@matthewcornell Do you have a recommendation for how to get a preview function added for the Reichlab site? Is it worth trying to move the hosting to Netlify with everything else, or should I find a way to implement a preview w/o switching where it's hosted?

I can see advantages to the former, but it sounds like we have some Reichlab site changes in the works that are waiting on the completion of this issue (i.e., perhaps not worth getting into dns changes, etc)

@matthewcornell
Copy link
Member

@bsweger If you want to stay with Pages, I don't have ideas off the top of my head. My first thought was basically creating a staging site by creating a fork of the repo and working there. Seems clumsy.

Doing some research:

This discussion thread asks for the feature, with the oldest response by GH on Dec 30, 2021 ("we have plans for. No ETA yet") and the newest on Nov 17, 2023 ("Unfortunately, we can't comment on any ETA for shipping this. .. s still actively being used internally in its alpha state"). So don't hold your breath. I haven't read the discussion, but there might be some work-arounds.

Here's a "marketplace" action: https://github.com/marketplace/actions/deploy-pr-preview (step-by-step here)

Another marketplace one: https://github.com/marketplace/actions/build-deploy-to-github-pages-and-deploy-pr-preview

Non-marketplace: https://daiyi.co/blog/pr-previews-for-github-pages/ . Not trivial?

@bsweger
Copy link
Collaborator

bsweger commented Mar 29, 2024

Thanks, @matthewcornell! Yep, I saw those links in my travels and will give them a closer read now that the "upgrade Ruby" stuff is in a better place.


Longer story on why putting GH pages on my work didn't work out...

The weirdness we saw yesterday stems from serving the site from a sub-directory (https://bsweger.github.io/reichlab.github.io/ vs reichlab.github.io/). Our _config.yml isn't set up to understand that the site's base URL might be a subdirectory.

For example, https://bsweger.github.io/reichlab.github.io/ is obviously....not good!

Most links there there 404 (including the .css links, hence the lack of styles!) because GitHub pages/Jekyll render them like this: https://bsweger.github.io/assets/css/spectre.min.css (404) instead of the correect https://bsweger.github.io/reichlab.github.io/assets/css/spectre.min.css.

Rather the going down the rabbit hole of relative URLs and Jekyll configs, I closed the "upgrade Ruby" PR from my fork and pushed those changes as a feature branch to the main repo and PR'd from there, so I could manually run the GitHub action that builds the site.

@nickreich
Copy link
Member Author

Noting that @annakrystalli has set up something where each hubverse package has a “pkgdown” site that is hosted on GitHub pages, but we see previews via netlify. See, e.g.

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

Successfully merging a pull request may close this issue.

3 participants