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

jamesfurey's avatar

Front End Deployment Strategy

Hi fellow Forge-rs!

What's your deployment strategy for front end builds?

"yarn" + "gulp --production" in your deploy script?

E.g.

cd /home/forge/default
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader

if [ -f artisan ]
then
    php artisan migrate --force
fi

yarn

gulp --production

Cheers!

0 likes
6 replies
Swaz's avatar

Not sure what others do, but I just compile my assets locally and commit to git. One less thing for the server to worry about.

1 like
jamesfurey's avatar

@Swaz Ah, right. Is this a Laravel Elixir project using versioning & cache busting?

Swaz's avatar

@jamesfurey Correct. Just need to get in the habit of running gulp with the --production flag before you deploy.

1 like
ejdelmonico's avatar
Level 53

@jamesfurey Really, it is a matter of choice but most of us run gulp --production and then commit to the repo before pushing. You do not have to do that way but keep in mind that the more tasks you ask the server to do for each deploy, increases the chances of a failed deployment. Having a failed deployment equals hours of wasted time...your time. Additionally, by running the production scripts before deployment, you can test and make sure that the processed files actually work...again saving hours of your time.

The way I do it is I develop on a dev branch and merge to master when I want to deploy via Envoyer/Forge. Master is connected to the autodeploy script. I hope that helps you figure it out.

1 like

Please or to participate in this conversation.