# Deploy Hooks > build-before.yml error

**URL:** https://discourse.roots.io/t/deploy-hooks-build-before-yml-error/13620
**Category:** bedrock
**Tags:** ansible, deploys, trellis, sage9
**Created:** 2018-09-16T12:32:46Z
**Posts:** 6

## Post 1 by @mattia — 2018-09-16T12:32:46Z

I am currently having issues with deployment to production server.

the provision and the deploy went ok, I am having problems with the deploy-hook.

this is the error that the console gives to me

 ![19](https://discourse.roots.io/uploads/default/original/2X/d/db2b481363bee7417a37942ae7f8fa9989767646.png)

I am using bitbucket, I have checked my public key and permissions and I am able to ssh onto the server without problem.

I am using sage 9, and this is my build-before.yml (I only uncommented the code, my theme is called sage, so I didn’t change the theme name).

 ![37](https://discourse.roots.io/uploads/default/original/2X/f/ff0f6edfe3b71ff9de2a44d553a6c4e67c7c732e.png)

if I comment the build-before.yml, no errors, but of course without this, I can’t upload the /dist/ directory in the production server.

What I am doing wrong?  
What I can try to do?

---

## Post 2 by @mattia — 2018-09-16T13:21:03Z

it was my error, I deleted the `-` before the name

```
- name: Install npm dependencies
  command: yarn
  connection: local
  args:
    chdir: "{{ project_local_path }}/web/app/themes/sage"

- name: Install Composer dependencies
  command: composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts
  args:
    chdir: "{{ deploy_helper.new_release_path }}/web/app/themes/sage"

- name: Compile assets for production
  command: yarn build:production
  connection: local
  args:
    chdir: "{{ project_local_path }}/web/app/themes/sage"

- name: Copy production assets
  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
```

---

## Post 3 by @MWDelaney — 2018-09-16T14:50:40Z

You need the `---` at the top also. Make sure you read the opening comments on that file: “Uncomment the lines below” means all the lines below not just some of them.

---

## Post 4 by @mattia — 2018-09-16T15:24:30Z

thanks @MWDelaney, i corrected that file.

I can do the deploy correctly, i can see the /dist/ directory on the production server.

I am trying to do some css changes, just to test if everything work correctly, but I can’t see these css changes on the production server.  
I inspect and open the css from the live website and I can’t see the css that I wrote.  
I can see on my local correctly, but not on my production link.

So i tried to add in the js an alert, just to understand, if I have the same problem with the js, but the js on the live website works. I can see the alert prompt.

am I missing a step?

I am doing like this:

- write some css rules (i can see the change on my mysite.test local)
- run `yarn && yarn run build:production` from the theme directory
- commit this changes to bitbucket
- run `./bin/deploy.sh production mysite.com` from the trellis directory

but as i said, the css is not updated.

---

## Post 5 by @mattia — 2018-09-16T18:36:56Z

I found a workaround with this

> [@Compiled CSS doesn't work as it should in production](https://discourse.roots.io/t/compiled-css-doesnt-work-as-it-should-in-production/9977/16):
>
> @MWDelaney, it works locally, just not on deploys. @ben’s link solved worked for me as well. As @QWp6t points out in that thread, here’s how to fix it– add the following: $navbar-dark-toggler-icon-bg: none; $navbar-light-toggler-icon-bg: none; to file: resources/assets/styles/common/\_variables.scss Thanks guys.

---

## Post 6 by @MWDelaney — 2018-09-17T14:26:57Z

This issue is now resolved in Sage:

> <https://github.com/roots/sage/commit/e72b4906264551dc00cd0890de74ae2bce0d77c8>
