Configure GitHub Actions to build and deploy the app#7
Merged
Conversation
uses `vite` because it seems to work well enough /shrug
The fact that we return anything means the app is running, so may as well serve the built app. That makes deployment easy... just ship the whole thing to one app service
Feel free to replace with something else... it's just nice to get pieces working
This should hopefully make things go (much?) faster. We'll install dependencies on the server when it's time to run
It's installed and it's what we use locally :)
Put all the dependencies for the sync server in dependencies and everything else in devDependencies. This should improve deployment time by reducing what we need to install
Without this, I was getting "Error [ERR_REQUIRE_ESM] ... Instead change the require of syncserver.js in C:\Program Files (x86)\iisnode\interceptor.js to a dynamic import()"
Azure gives us a pipe to listen on, represented as a string path... not a port number.
Not ideal, because now we can't use the local server as our peer. But we don't currently have any tooling for a run-time configuration option here.
Started with an out-of-date template from Azure... let's make sure we can use the latest versions
This gives us a way to use the local syncserver in local development and the production sync server in prod. Longer term, it might be a good idea to have UI to configure this, but it's not critical at the moment
brentkeller
approved these changes
Jan 30, 2023
Member
brentkeller
left a comment
There was a problem hiding this comment.
This looks really good. Thanks for a nice elegant solution here and for all the frustration you endured to figure out the Azure pitfalls.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This took a bunch of faffing around, as the Azure method of deploying apps from GitHub is now entirely based on GitHub Actions (so this isn't the same as DevBot or the blog or the public site).
Work not in this PR:
SCM_DO_BUILD_DURING_DEPLOYMENTset totrue(this makesnpm install --productionrun after a deployment)Work in this PR:
dependenciesis only what is needed to run in prod anddevDependenciesis everything else. This makes deployment faster because we install less on the app servicePORTto not assume an integerThe end result is that you can navigate to xdev.devresults.com and see the current app. The sync server is up and running so if you use the same documentID on a different machine or browser, you'll see pretty quick synchronization between the two clients. Pushes to
mainwill automatically deploy the app, and there's also a button to deploy on demand (I think it deploysHEAD, but I haven't checked)Further work:
-the address of the "always-on" peer is guessed at run-time, but it would be nice if it was a user configuration option