getlarge / nx-heroku

Nx plugin to quickly deploy and promote your Nx apps on Heroku
MIT License
3 stars 0 forks source link

Question about the "deploy" step (#16) #24

Open enaluz opened 1 month ago

enaluz commented 1 month ago

In the README, the deploy target is said to have a deploy step. I tried reading through the source code to better understand how it works, but couldn't figure out what exactly what happens in the deploy step.

For context, I have an monorepo named "frontend", which contains some apps (/apps/web, for example). When I try firing off a deployment for this project whenever there is a merge to main (via Github Actions), the /dist directory doesn't show up when I view the available files from heroku run bash -a <app-name>. I'm guessing that no build command is actually running in Heroku, which is why there's no dist folder. When I try to view the app, I get an nginx 404 error.

Happy to provide more context.

Thanks!

getlarge commented 1 month ago

I don't know how familiar you are with deployment on Heroku. Each application is backed by a Git repo and the deployment phase is just about pushing your code to the corresponding Git remote on Heroku. You might want to read this. The corresponding code in the executor can be found here.

Your dist directory is most probably ignored in your Git repository config, leading to your deployment to not contain the build. To build a JS app in Heroku, you would usually deal with build hooks, and the process would run on Heroku side. You can also read this section from the README.md.

When/if you get it to work, an example setup would be a great contribution :)