# wpwaterfall.yml reference

> Set the PHP version, build steps, writable folders, deploy hooks, and default environment variables for a site deployed from Git.

Source: https://docs.wpwaterfall.com/code/wpwaterfall-yml

`wpwaterfall.yml` sits at the root of your site repository. It tells WP Waterfall how to build and deploy your code. Every key is optional, and you add only what your site needs.

WP Waterfall reads the file on every build, which a push to the environment's branch starts. A change to `wpwaterfall.yml` takes effect on the next build.

```yaml
php: "8.5"
build:
  - composer install --no-dev --optimize-autoloader
writable:
  - wp-content/uploads
  - wp-content/cache
deploy:
  hooks:
    - wp core update-db
    - wp cache flush
env:
  WP_ENVIRONMENT_TYPE: production
```

## php

The PHP version for the build and for the running site. WP Waterfall supports PHP 8.3, 8.4, and 8.5 for new work, and keeps running sites that already use PHP 8.1 or 8.2 until their removal date (see [Change PHP settings](https://docs.wpwaterfall.com/tools-php-settings)). New sites start on 8.5.

```yaml
php: "8.5"
```

Write the version as a string, in quotes. Without quotes, YAML reads `8.5` as a number, and a future `8.10` would read as `8.1`.

## build

A list of shell commands that run in order on every push, in a fresh build container. The container has Composer and Node 24, and it uses the PHP version from the `php` key. Commands run from the repository root.

```yaml
build:
  - composer install --no-dev --optimize-autoloader
  - npm ci
  - npm run build
```

- Whatever the commands create, such as `vendor/` or compiled assets, is part of the release. You do not need to commit it.
- If a command fails, the build fails. WP Waterfall creates no release, and the live site stays on the current one. The build log shows on the **Builds** tab of **Deploys** on the **Info** tab.
- A build can run for up to 20 minutes, and a file can hold up to 30 steps.
- Do not put secrets in build commands. See [env](#env).

To name a step or shorten the time limit, write `build` in the long form. `timeout_minutes` takes 1 to 20.

```yaml
build:
  timeout_minutes: 10
  steps:
    - name: Install PHP packages
      run: composer install --no-dev --optimize-autoloader
```

## writable

The folders your release writes to. Two folders are always writable on live, and you do not have to list them: `wp-content/uploads` and `wp-content/cache`. What they hold, and what backups and promotes do with them, is in [Manage files](https://docs.wpwaterfall.com/files-manager#which-folders-are-writable-on-live).

```yaml
writable:
  - wp-content/uploads
  - wp-content/cache
```

- PHP files in these folders do not run. Do not use them to store code.
- Code is never writable on live: plugins, themes, mu-plugins, WordPress core, and `wp-config.php` stay in the read-only release. A folder under `wp-content/plugins` or `wp-content/themes` cannot be listed here to make it writable.
- WP Waterfall ignores any entry other than these two folders and says so. The build log prints "wpwaterfall.yml writable: <folder> is ignored. Live code is a read-only release, so only wp-content/uploads and wp-content/cache are writable on live, and neither needs to be listed." The **wpwaterfall.yml** tab of the **Deploys** dialog shows the same sentence in a warning, and the file stays valid.

When a plugin tries to write to a read-only path, see [What if a plugin writes into its own folder?](https://docs.wpwaterfall.com/code/git-workflow#what-if-a-plugin-writes-into-its-own-folder).

## Deploy hooks

The `deploy.hooks` key is a list of WP-CLI commands that run each time a release goes live, after the code is mounted and OPcache is reset.

```yaml
deploy:
  hooks:
    - wp core update-db
    - wp cache flush
```

- Hooks run in order. They have about one minute in total.
- Hooks use the same WP-CLI allowlist as the WP-CLI runner in the dashboard. The node agent enforces it, so a command such as `wp eval` is refused.
- WP Waterfall clears the server cache after the hooks finish. You do not need a hook for that.
- An unknown key anywhere in the file is an error, so a typo does not pass silently.

## env

Default values for environment variables. Use it for settings that are safe to keep in Git. A name that starts with `WPWATERFALL_` is reserved for the platform and fails the check, and a value can be up to 4,096 characters.

```yaml
env:
  WP_ENVIRONMENT_TYPE: production
  MY_FEATURE_FLAG: "on"
```

**Secrets never go in `wpwaterfall.yml`.** Anything in the file lives in your repository history and is visible to everyone with access. Set API keys, tokens, and passwords on the **Environment variables** card on the **Info** tab instead. See [Environment variables](https://docs.wpwaterfall.com/environment-variables).

A value you set in the dashboard replaces a default with the same name from `wpwaterfall.yml`.

## Full example

A site that uses Composer for WordPress plugins and npm for a custom theme:

```yaml
php: "8.5"

build:
  - composer install --no-dev --optimize-autoloader
  - cd wp-content/themes/my-theme && npm ci && npm run build

writable:
  - wp-content/uploads
  - wp-content/cache

deploy:
  hooks:
    - wp core update-db
    - wp cache flush

env:
  WP_ENVIRONMENT_TYPE: production
```

## Related

- [How Git deploys work](https://docs.wpwaterfall.com/code/git-workflow)
- [Environment variables](https://docs.wpwaterfall.com/environment-variables)
