Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jrean's avatar
Level 8

Build strategy

Hi guys,

Can I have some feedback about what is the best approach?

  • Build assets locally (gulp production & Co.) then push and deploy
  • Push, build on the remote and then deploy

Locally / remotely?

Do you have some readings to share?

Cheers,

0 likes
3 replies
bobbybouwmann's avatar

I don't really have a link for you to read about, but I always compile everything locally. So I push all the changes to git and then I pull the build files to server. This means you don't have to install gulp and npm on your server if you don't use it anyway. It also means you don't have to download all the npm dependencies on your server. There are a lot of those dependencies.

Working with teams you might get issues with this since you all compile your files and you end up with different versions. Our solution to that is letting only one guy push the compiled assets to git.

2 likes
jrean's avatar
Level 8

Thank you @bobbybouwmann. That sounds a great way of doing. I work alone on this project so I directly push to a --bare repository on the server.

So, if I properly understood you suggest:

  • Feature branch
  • Merge to master
  • Compile build & Co.
  • Tag a release
  • Push master (tag) to Github / or server

Then I use git hooks to perform my deploy strategy and some additional tasks...

Thxs

Please or to participate in this conversation.