If it’s just a js file, you can deploy that in a theme component.
Theme Components can be copied to a site, so long as it is accessible via https using the discourse_theme gem.
You can even use an existing remote production site for that purpose, no need to set up a local one.
See Discourse Theme CLI (console app to help you build themes) - howto / developers - Discourse Meta