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?
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.
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);