Automatically build vite-react on new git commit and serve build folder ("/dist")?
afikhabaz
HOBBYOP

2 years ago

Hello!

As the title says, I was wondering if I could automatically build my project when a new commit pushes to the git branch that's in use and serve the build folder which in my case is "/dist".

I'd love to do that of course to save resources, Because I don't need a server to run node process just to serve static files. and of course for the convenience of not having to manually upload the static files each time.

PID: 8ba72af9-5b5a-4fc5-bc55-c1e3eeded975

Thanks, Afik.

Solved

10 Replies

2 years ago

of course you can!

you just need the nixpacks.toml and Caddyfile from that repo


afikhabaz
HOBBYOP

2 years ago

Hay, Thanks for the reply. I assume I'll have to just include them on my git repo? Do you know if it's possible to provide the necessary data to railway separatly from the git repo? (Without pushing the files to git).


2 years ago

just connect your git repo in the service settings


afikhabaz
HOBBYOP

2 years ago

Thanks for the quick replies mate, Much appreciated!


afikhabaz
HOBBYOP

2 years ago

Though I can't manage to get it done. It was so easy to get the backend up but I'm really not enjoying trying to deploy my frontend efficiently.


afikhabaz
HOBBYOP

2 years ago

I could run it as a process, but why... It's just static files.


afikhabaz
HOBBYOP

2 years ago

I was trying to use your template, But once I clone your template into railway I can't change the upstream to be my git repo...


afikhabaz
HOBBYOP

2 years ago

By your words I'm feeling like it should be easy I guess I'm missing something.


2 years ago

you don't need to change the upstream, you just need to copy the files into your repo


2 years ago

!s


Status changed to Solved brody over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...