FlyWP

Deployments

Deploy Hooks

Deploy hooks let you run custom commands during the deployment lifecycle.

Hook Stages

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

Configuration

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!"}'

Environment Variables

Your deploy hooks have access to these environment variables:

  • FLYWP_SITE_PATH — path to the site root
  • FLYWP_RELEASE_PATH — path to the current release
  • FLYWP_DOMAIN — the site's primary domain
  • FLYWP_PHP_VERSION — the PHP version for this site