# Deploy fails at WordPress setup task

**URL:** https://discourse.roots.io/t/deploy-fails-at-wordpress-setup-task/5109
**Category:** bedrock
**Tags:** deploys
**Created:** 2015-10-23T21:25:30Z
**Posts:** 13
**Showing post:** 11 of 13

## Post 11 by @fullyint — 2015-10-24T09:38:24Z

Great! Your steps appear correct as I glance over them, although I didn’t compare step-by-step with the README or with the [docs](https://roots.io/trellis/docs/deploys/).

One thing you’ll probably need to address, if you haven’t already, is how to get your theme’s compiled assets on the server. The [`dist` directory](https://github.com/roots/sage/blob/8046666f7ce793435cedbcaa8d4bc21bbb3e136f/.gitignore#L3) typically wouldn’t be committed to your repo and thus wouldn’t be retrieved when the deploy clones the repo.

The recommended approach is to compile the assets on your local machine (`gulp --production`) then have the deploy sync the `dist` directory to your remote server. As @swalkinshaw recommended [here](https://discourse.roots.io/t/deployment-with-the-new-trellis-hooks/5016/2), add this line to your `deploy.yml`:

```
deploy_build_before: "{{ playbook_dir }}/deploy-hooks/build-before.yml"
```

Then create a `deploy-hooks` directory in your `ansible` directory, with a `build-before.yml` file that has contents similar to what @swalkinshaw listed at the link above. Decide which tasks to include. At a minimum, I think you’d want the last task `- name: Copy project local files`. You’ll want to adjust the paths for your theme name, etc.

That’s a little complex but charge through it and I think you’ll continue understanding it as well as you’ve done with the other steps before this.

---

_[View the full topic](https://discourse.roots.io/t/deploy-fails-at-wordpress-setup-task/5109)._
