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

a year 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

brody
EMPLOYEE

a year ago

of course you can!

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


afikhabaz
HOBBYOP

a year 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).


brody
EMPLOYEE

a year ago

just connect your git repo in the service settings


afikhabaz
HOBBYOP

a year ago

Thanks for the quick replies mate, Much appreciated!


afikhabaz
HOBBYOP

a year 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

a year ago

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


afikhabaz
HOBBYOP

a year 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

a year ago

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


brody
EMPLOYEE

a year ago

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


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody 12 months ago


Loading...