-
Notifications
You must be signed in to change notification settings - Fork 2k
Change Netlify to deploy both UI and website #6167
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
Conversation
I don’t expect this to work right away, let’s see 😯
🤔 I’ll likely extract this into script files because it’s ridiculous already.
Re the conditional redirection, you can see it in action by visiting the deployment for this branch vs the one for this branch, which I named to follow the UI pattern. The latter jumps directly to |
This may at least permit the caching of gems, which seems like the slower step.
ugh… the deployment is timing out but I think if I can get the cache happening for gems, it’ll work…?
This is redundant due to caching, I suppose!
I think this will time out 😞
I’d return this to draft if I could; deployments are now timing out due to exceeding a 15-minute limit. I’ve written to Netlify support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Copying the UI build into the website build to serve both sites is a clever solution to this issue.
The only blocking things are the comment that I think can be improved and then it looks like you have a handful of test commits that can be tidied and squashed.
.netlify/build-and-move.sh
Outdated
#!/usr/bin/env bash | ||
|
||
# Build the static web site in website/build | ||
# bundle install should be cached??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you got to the bottom of this in finding netlify/build-image#196
Can you update the comment to speak to this netlify issue?
.netlify/build-and-move.sh
Outdated
|
||
# Build the static web site in website/build | ||
# bundle install should be cached??? | ||
bundle exec middleman build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure this is fine, and I don't know what the equivalent would be if we were to use the docker container setup, but this difference between local development and netlify build gives me pause.
[[redirects]] | ||
from = "/*" | ||
to = "/ui/index.html" | ||
status = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nice that netlify also offers the _redirects
file option.
Hey, @DingoEatingFuzz, I’m sorry to have requested review apparently too soon, as someone from Netlify let me know that it’s actually possible to have two different deployments for the same repository. I think that’ll be a better approach as each deployment can proceed from the relevant subdirectory, which will preserve caching. I attempted to retract the review request but I guess it didn’t take! So I’ll look into this option today, I have high hopes 🤞 |
Oooooh, awesome! |
IT TURNS OUT that there can be multiple Netlify sites for a repository. They need to be configured via their UI vs this file, as the file overrides what’s set in the UI.
Since the UI and website don’t need to share a deployment, this file is unnecessary.
Hopefully this will cause nomad-website to stop showing UI deployments?
This is decomposed into the web UI configuration of each of the two Netlify sites.
This isn’t needed since there won’t be anything at / anymore.
Closing in favour of #6194. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This makes Netlify build both
ui/
andwebsite/
. I’ve extracted thebuild steps to their own script, as it was getting unwieldy to have
it all jammed into a single line in
netlify.toml
.The redirects are dynamic based on whether the branch being deployed
is determined to be for the UI. When that’s the case, visiting
/
will automatically forward you to
/ui
, which was the behaviour beforethis PR. For all other PRs, visiting
/
will show the documentationroot and you’ll have to manually append
/ui
to see the UI.Netlify deployments with this scheme are taking significantly longer
as it appears that caching of dependencies isn’t supported for
subdirectories, so the gems and npm packages are being fetched and
rebuilt every time. Some background here:
netlify/build-image#196