-
Notifications
You must be signed in to change notification settings - Fork 16
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
Investigate GHA and/or submodules for maintaining ioos.us menu bars? #263
Comments
Hey Micah, One thing to note is that there isn't automated deployment process for the ioos landing pages, the current process is a bit extra IMO (build docker image, push to Dockerhub, pull and deploy on ECR). Since we're just serving up static content, would it make sense to move away from this process and host these sites on Github pages or S3+Cloudfront? |
Hi @nguyandy. Thanks! My understanding of git submodules is that they can serve in effect as a folder symlink does on unix, but not a file symlink, if that makes sense. So, as long as the top menu content (header.html and whatever else) could be housed in a subfolder, presumably under https://github.com/ioos/ioos-us/tree/master/views where it is currently, a submodule link will work. That's the part I don't know about this site framework. If you can look into that, great! Then, a submodule/branch could be added similar to the As far as hosting platform, investigating GH Pages seems like a great idea, especially if the site build step could be written as a GitHub Action to run automatically on commit. If not, then S3 sounds like a good alternative too. Before deciding on a hosting change though, we'll need to discuss internally here. The submodule approach I think is worth looking into whenever you have a chance though. |
Notes from Micah: "One problem we realized after creating that issue that we'll need to bear in mind is that any automated GHA will stop running on a repo if there are no commits made to it after 90 days (I believe). I'm wondering if instead we should consider other ways to redesign ioos.us, but I don't know what alternatives might be (one big ioos.us site/repo using the same framework as the existing sites with a single nav bar, Wordpress, etc). " |
@ocefpaf mentioned these required workflows and configuration variables just this week https://github.blog/2023-01-10-introducing-required-workflows-and-configuration-variables-to-github-actions/ It could be worth investigating how those could make our lives easier for these common GHA across repos. |
@MathewBiddle it seems that I waited way too long to send you that page: https://docs.github.com/en/[email protected]/actions/using-workflows/required-workflows GH is sun-setting that feature and is supporting only those who got into the beta phase. Sadly this is no longer an option. Sorry for the noise. However, this one may be a viable option to simplify the current setup: https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-to-reusable-workflows |
Hey @mwengren , By using a web component, specifically the use of shadow DOM, we can ensure that styles and scripts used by the header/footer are encapsulated. This means they won’t mess with whatever else is running on the site—giving us the best mix of compatibility and portability. We’ll host the web component's JS file on S3 and serve it through Cloudfront. Adding them to a site is a breeze:
And then drop in the custom tags wherever you need them:
We can also toss in some attributes to tweak settings or add customization options down the road:
Workflow for updating the header/footer
Cloudfront lets us set HTTP cache headers and even invalidate old cached versions when we push updates. That means we can keep things fresh without any fuss. I’ve got a POC already up and running on S3 here: And I've slapped this header into a bunch of different projects to see it in action—it’s working like a charm. I think this setup will smooth out a lot of our headaches, but please let me know if you see any potential snags or have questions. |
Hi @nguyandy, sorry for the slow response! This sounds promising to me. I had a couple of reactions/questions:
So, especially regarding the Items 3 and 4, this might turn into its own project to implement these changes across all of our ioos.us sites. I'm thinking we might want to assign this implementation project to a new staff member we have coming on board soon. Will discuss with our team and figure out a plan. In the meantime, please let me know any thoughts you have on the above. If we can get some agreement on Items 1 and 2, I think we can move forward with this approach. Thanks! |
@nguyandy this looks promising! Thanks for digging into it and putting this proposal out here. My first reaction is in line with @mwengren's first comment above. Where will the source be stored and how can we contribute to it? It would be nice to have it in a GitHub repo. Otherwise, I'm on board. But, addressing Micah's other notes is essential too. |
Hey @mwengren, @MathewBiddle, sorry I thought I replied
Where ever you think makes since. It is a node project, the code gets minified during the build process. It should be relatively easy for anyone to make changes to the components. If you have a repo/location in mind for this, let me know and I can start moving things over!
Yes, the components themselves can be integrated easily into any of the websites by importing the component src file like in the example from my previous post. The styling is encapsulated as well so it shouldn't affect any site design.
In the node project directory, we can have a separate This is the current config I through together for the example above, but can be refined to fit our needs.
I don't see why not! I imagine we would have a main template repo, where each of the subsites will have their own project directory that contains their landing page content. You're right, we'd probably have to figure out how to handle the mapping/routing if we want to deploy it as a single website. These static websites are pretty small in size though. To avoid overcomplicating things, we can continue to build the subsites individually through a CI/CD pipeline to start. |
Hi @nguyandy thanks, and we'll get back to you with more details soon-ish. I'm just pinging @sarinamann-noaa on this because she'll be taking on coordinating this from our side and reaching out to each of the maintainers of the various *.ioos.us sub-sites to coordinate their implementing the new menu framework. IOOS will probably have an internal meeting to kick the project off first, and before anything is deployed, we (IOOS Ops Division/DMAC) need to decide how to update the menubar content itself ( |
@MathewBiddle and I have been working on using GHA to synchronize the menu bars on our 'IOOS DMAC Documentation Portal' GitHub Pages site (https://ioos.github.io).
xref: ioos/documentation-theme-jekyll#3
In that site, we use specific branches in the https://github.com/ioos/documentation-theme-jekyll repo to maintain a common Jekyll 'theme' and certain configuration files used by the theme, which are then referenced as git submodules in the downstream repositories that host DMAC documentation content via GH Pages.
For example:
Could we use a similar approach to synchronize the menu bar content in the various *.ioos.us repos that we host on GitHub (e.g. https://github.com/ioos/comt-landing, https://github.com/ioos/hfradar-dac-landing)?
Referring to this menu bar at the top of each ioos.us sub-site:
I'm not too familiar with how these sites work (NodeJS?), I know there's a external rendering process and the ioos.us sites aren't actually hosted on GitHub of course, but would just the menubar content sync via submodule be possible here?
We recently added GHA support to automate the submodule synchronization between the Jekyll content sites, see: https://github.com/ioos/ioos-documentation-jekyll-skeleton/blob/gh-pages/.github/workflows/sync_theme.yml. This job is run on a daily schedule and also any time new commits are pushed to each documentation repo.
If the menubar code could be kept in a separate branch of this repo, then I would think a separate submodule/GHA sync technique might work.
As motivation, I noticed we have at least one dead link in the current menu bar that needs to be updated (under Viewers > COMT):
http://oceansmap.com/comt/
The text was updated successfully, but these errors were encountered: