Deployments
Deploy hooks let you run custom commands during the deployment lifecycle.
| Stage | When it runs |
|---|---|
before_install |
Before pulling code from Git |
after_install |
After pulling code, before going live |
after_live |
After the new release is live |
on_failure |
If any step fails |
Create a .flywp/deploy.yml file in your repository root:
after_install:
- composer install --no-dev --optimize-autoloader
- npm ci
- npm run production
after_live:
- wp cache flush
- wp rewrite flush
- curl -s https://hooks.slack.com/services/xxx -d '{"text":"Deployed!"}'
Your deploy hooks have access to these environment variables:
FLYWP_SITE_PATH — path to the site rootFLYWP_RELEASE_PATH — path to the current releaseFLYWP_DOMAIN — the site's primary domainFLYWP_PHP_VERSION — the PHP version for this site