Configuration File
Deploy
The [deploy] section allows you to define commands that will be executed before and after the deployment of your application.
# Configuration file with a deploy section
app = 'myapp'
[deploy]
[deploy.pre]
command = 'npx prisma migrate deploy'
[deploy.post]
command = 'npm run cache:warm'
Each section you declare must have a command: deck deploy rejects a section with a missing or blank command before building your image. Each command can be written as a string or as an array. Commands are not run through a shell, so see Commands to learn how each form is run.
deploy.pre
The [deploy.pre] section defines a command that will be executed before the new version of the application is deployed. If this command fails, the deployment will be aborted.
This is useful for running database migrations or other tasks that need to be completed before the new code is live.
To run several steps, use the array form to call a shell:
[deploy.pre]
command = ['sh', '-c', 'npx prisma migrate deploy && npm run db:seed']
deploy.post
The [deploy.post] section defines a command that will be executed after the new version of the application is deployed and running.
This is useful for tasks such as clearing caches or sending notifications.