# The deploy file is here

Source: https://blog.fortrabbit.com/deploy-file-launched
Published: 2026-10-07
Author: Rafik Abdulwahab
Tags: chronicles

> A deploy file in the Git repository now holds build commands, cached directories and the deployment strategy. It is versioned and reviewed with the code.


## What's new

The deploy file is live on the new platform. Deployment settings can now live in the Git repository, in a file at `.fortrabbit/deploy.yml`.

Until now, build commands, post-deploy commands, cached directories, the Git source directory and the deployment strategy all lived in the dashboard or came through the API.

Changing how an app is built used to happen outside the repository. Nobody could review it in a pull request. `git log` did not know about it. A colleague who cloned the project had to open the dashboard to see how it deploys. And when a deploy broke, the answer to "what changed?" was split across two places.

The deploy file moves those settings into the repo. Now they're reviewed, versioned and copied with the code.

## Infrastructure as code, for deployment

Infrastructure as code (IaC) is the practice of describing infrastructure in versioned files instead of configuring it by hand. Terraform, Ansible, Kubernetes manifests and GitHub Actions workflows all use the same idea. The deploy file applies it to the deployment settings of a fortrabbit environment.

A deploy file for a Laravel app:



```yml [.fortrabbit/deploy.yml]
apiVersion: 1.0
build:
  buildCommands:
    - composer install --no-dev --prefer-dist --no-interaction
    - npm ci && npm run build
  postDeployCommands:
    - php artisan migrate --force
  cachedDirectories:
    - node_modules
distribution:
  strategy: replace
  excludePatterns:
    - storage
```

JSON works too, as `.fortrabbit/deploy.json`. Every key, every default and every validation rule is in the docs:

- [Deploy file docs](https://docs.fortrabbit.com/platform/deployment/deploy-file)

## What changes

- **Reviewed with the code:** A new build step goes through the same pull request as the code that needs it.
- **Read from the deployed commit:** Every deployment reads the file from the commit it deploys. A branch that needs a different build command carries its own file.
- **Copied with the repository:** A new app created from a repo with a deploy file skips the deployment steps in the dashboard.
- **Editable by agents:** A coding agent changes a YAML file in the repo. No dashboard access, no API token.

Once a deploy file is found, the dashboard shows its values as read-only and links to the file. It keeps the values saved in the dashboard, but does not use them. Delete the file and push to use and edit them there again.

## Outlook

This is the first release. It covers how code is built and how it reaches the environment. We plan to extend infrastructure as code from here. Maybe that means moving more, possibly all, of an environment's configuration into YAML files in `.fortrabbit`. No promises on what comes next or when.

## References

- [Deploy file](https://docs.fortrabbit.com/platform/deployment/deploy-file)
- Tell us what you think! 