Check deploy hooks in the docs and deploy-hooks/build-before.yml. You can setup that hook to either build the assets on your destination server or to simply copy the locally built files.
Thank you @cfx. I’m not totally clear on the process. Do I need to create and reference a new .yml file in order to say, configure Ansible to run the gulp tasks in the roles/deploy/hooks/build-after.yml tasks? Is there an example you might be able to point me to?
That specific file has examples and comments that should get you through it all. Also, these are Ansible playbooks for Trellis and they have little/nothing to do with Gulp unless you explicitly configure the sections in that file to run Gulp and build your Sage assets before copying them to the destination server as part of your deploy.
For best results, read all those docs, not just the specific section I linked to
Oh look. trellis/deploy-hooks/build-before.yml contains the locally run version:
`# Placeholder `deploy_build_before` hook for building theme assets locally
# and then copying the files to the remote server
#
# Uncomment the lines below and replace `sage` with your theme folder
#
# ---
# - name: Run npm install
# command: npm install
# connection: local
# args:
# chdir: "{{ project.local_path }}/web/app/themes/sage"
#
# - name: Run bower install
# command: bower install
# connection: local
# args:
# chdir: "{{ project.local_path }}/web/app/themes/sage"
#
# - name: Run gulp
# command: gulp --production
# connection: local
# args:
# chdir: "{{ project.local_path }}/web/app/themes/sage"
#
# - name: Copy project local files
# synchronize:
# src: "{{ project.local_path }}/web/app/themes/sage/dist"
# dest: "{{ deploy_helper.new_release_path }}/web/app/themes/sage"
# group: no
# owner: no
# rsync_opts: --chmod=Du=rwx,--chmod=Dg=rx,--chmod=Do=rx,--chmod=Fu=rw,--chmod=Fg=r,--chmod=Fo=r
`
I guess the first option of running gulp on the server would be a matter of updating trellis/roles/deploy/hooks/build-after.yml with similar code, updating paths to something like {{ deploy_helper.new_release_path }}/web/app/themes/my_theme
Thank you very much.
Man it sure is easier than I deserve to create web apps. Seems like somebody has done just about everything for us already. : )