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

Swaz's avatar
Level 20

Add gulp to deploy script.

I am using Elixir and would like to run gulp --production every time I deploy. Has anyone done this before? And is there any reason why I would not want to do this?

0 likes
4 replies
alenabdula's avatar
Level 13

I try to follow the process of developing locally, testing on staging server, and then pulling in changes to my production (usually by SSH).

Not sure how Gulp would fit into this particular process. Wondering if it's even possible. I mostly use Gulp for Front-End stuff.

Swaz's avatar
Level 20

I clicked marked as answer by accident.

I am developing locally, but every now and then I commit to git, which pushes changes to live server. And sometimes I forget to minimize my css and js.

alenabdula's avatar

I guess you could set up a Gulp task for gulp-shell and use it to execute git push.

I'm not sure how Elixir takes care of that, I haven't reviewed the tool in detail just yet. I still use command line.

mikevrind's avatar

I'm using a private Gitlab server in which I have created a webhook for the deployment. This webhook makes a POST request to a specific page(route) in my Laravel project.

In this route I'm using Laravels Remote package (illuminate/remote) to make setup a local connection to the CLI. After a couple of checks and validations I run several commands including 'gulp --production'.

                # Browse to the project root
                $sshCommands[] = 'cd '.base_path();

                // more commands

                # Recompile all assets
                $sshCommands[] = 'gulp --production';

                # Execute the commands
                SSH::into('production')->run($sshCommands);

Please or to participate in this conversation.