Ansible playbook gulp dist/production assets not moving to staging environment

I’ve got a stage.example.com website that is deploying just fine with bedrock-ansible, all the content appears correctly except that the web/app/themes/sage/dist folder doesn’t exist so none of the styles, scripts, or images work. I just get a 404 error.

The obvious answer seems to be that the dist directory is ignored so it won’t be pushed to the github repository, but I don’t want to remove this from .gitignore so what am I missing? Why won’t my gulp --production assets deploy to my staging environment?

Only relatable topic I could find is 3806

I solved my own problem, gulp wasn’t being run on the Ansible host during deploy. While taking a look at the roots-example-project I found this in the ansible/group_vars/production file:

- path: "{{ project.local_path }}/web/app/themes/sage"
  cmd: npm install
- path: "{{ project.local_path }}/web/app/themes/sage"
  cmd: bower install
- path: "{{ project.local_path }}/web/app/themes/sage"
  cmd: gulp --production

project_local_files:
- name: compiled theme assets
  src: "{{ project.local_path }}/web/app/themes/sage/dist"
  dest: web/app/themes/sage

So I simply added these lines to my ansible/group_vars/staging and presto! Worked like a charm. I’m going to submit a pull request.