Understanding the build-before.yml hook for building on the server

I want to preface this by thanking anyone who is able to provide any type of insight here. My issue does concern both Trellis and Sage, so apologies ahead of time if this is not the correct forum for this question.

I understand that we really should never be committing our dist folder to our repository: this folder should be created upon deployment from our source files.

Unfortunately, I am having some issues using the build-before.yml hook. When I run a simple yarn build from my local machine, I see everything compiled correctly, but for whatever reason, when I run the Ansible deploy playbook, I watch the dist folder get deleted and recreated, but there are font files missing from the folder that do exist when I just run the regular yarn build. There are also some styles missing that I have added, almost as though the yarn build:production is building from cached files that don’t include my new changes. Is this a thing?

When running the deploy, I ultimately receive this error. This might not be directly related to the fonts/styles, but wanted to provide it, as well:

TASK [deploy : Finalize the deploy] ********************************************
System info:
  Ansible 2.5.2; Darwin
  Trellis at "Dynamically increase `ansible_group_priority` for selected env"
---------------------------------------------------
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 13] Permission denied: '/srv/www/website.com/releases/20180514225131/web/app/themes/sage/vendor/doctrine/inflector/LICENSE'
fatal: [18.236.255.133]: FAILED! => {"changed": false, "msg": "rmtree failed: [Errno 13] Permission denied: '/srv/www/website.com/releases/20180514225131/web/app/themes/sage/vendor/doctrine/inflector/LICENSE'"}

I am using Sage 9.0.1 with Ansible 2.5.2 (which I understand is untested). I can run that verbose, if that is helpful.

Overall, really loving Sage 9. Because this is a personal project, I am fine with committing the dist for now, but really want to be able to deploy “correctly” and streamline this process. Any help is much appreciated.

Thanks!

Jed

I am going to consider this issue closed and create a couple more with more succinct, answerable questions. I have kinda gotten this to work, but still need some explanation. Thank you!

[Errno 13] Permission denied while deploying to DO droplet / https://www.google.com/search?q="rmtree+failed"+site%3Adiscourse.roots.io

Worked like a charm thanks bro!