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

youngjedi's avatar

Deploying with Gulp, Best Practices & Gitignore

Hello,

I've looked through threads already but could use some additional guidance and advice. I can't seem to find a consensus or best practice.

My Problem: Every time gulp is run public/ and public/build have a number of new files generated which I need to ensure I exclude before committing. This is a bit annoying so I'm keen to use .gitignore on those folders.

My question is since gulp should not be run on production (correct?) we need to commit the assets at some point. What would be the best way to do this as part of our workflow? Our current workflow is:

Push to 'development' from localhost (without assets) - Envoyer automatically deploys to our QA server and runs gulp as part of the deploy task Push to 'staging' from local host (without assets) - Envoyer automatically deploys to our STAGING server and runs gulp as part of the deploy task

Question: How to deploy now to PROD without running gulp on the server?

My current thought is to have a build scripts that runs gulp on our staging branch and commits to master which will then auto deploy via Envoyer. The build script could be executed by a slack command.

Lastly, since others (hopefully!) will be looking at this thread - does anyone have PRO gulp tips to share?

Thanks!

0 likes
0 replies

Please or to participate in this conversation.