2022-09-06 09:17:58 +02:00
|
|
|
# YAML
|
2021-08-29 18:56:26 +02:00
|
|
|
|
2023-07-29 12:02:46 +02:00
|
|
|
Deployer supports recipes written in YAML. For validating the structure, Deployer uses
|
|
|
|
the JSON Schema declared in [schema.json](https://github.com/deployphp/deployer/blob/master/src/schema.json).
|
2022-03-22 20:39:45 +01:00
|
|
|
|
2023-07-29 12:02:46 +02:00
|
|
|
Here is an example of a YAML recipe:
|
2022-03-22 20:39:45 +01:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
import:
|
|
|
|
- recipe/laravel.php
|
|
|
|
|
|
|
|
config:
|
2022-09-06 09:17:58 +02:00
|
|
|
repository: "git@github.com:example/example.com.git"
|
2022-03-22 20:39:45 +01:00
|
|
|
remote_user: deployer
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
example.com:
|
2022-09-06 09:17:58 +02:00
|
|
|
deploy_path: "~/example"
|
2022-03-22 20:39:45 +01:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
build:
|
2022-09-06 09:17:58 +02:00
|
|
|
- cd: "{{release_path}}"
|
|
|
|
- run: "npm run build"
|
2022-03-22 20:39:45 +01:00
|
|
|
|
|
|
|
after:
|
|
|
|
deploy:failed: deploy:unlock
|
|
|
|
```
|
|
|
|
|
2023-07-29 12:02:46 +02:00
|
|
|
YAML recipes can include recipes written in PHP. For example, some tasks maybe written in PHP and imported into YAML.
|
2022-03-22 20:39:45 +01:00
|
|
|
|
2023-07-29 12:02:46 +02:00
|
|
|
Conversely, it's also possible to import a YAML recipe from PHP using the [import()](api.md#import) function.
|