Netlify Drop Deployment
This page documents deployments using the dpl v2. Please see our blog post for details. You can check previous dpl v1 documentation here.
Travis CI can automatically deploy files to Netlify Drop after a successful build.
For a minimal configuration, add the following to your .travis.yml
:
deploy:
provider: netlify
site: <site>
auth: <encrypted auth>
edge: true # opt in to dpl v2
Status #
Support for deployments to Netlify is stable.
Known options #
Use the following options to further configure the deployment.
site |
A site ID to deploy to — required, type: string |
auth |
An auth token to log in with — required, secret, type: string |
dir |
Specify a folder to deploy — type: string |
functions |
Specify a functions folder to deploy — type: string |
message |
A message to include in the deploy log — type: string |
prod |
Deploy to production — type: boolean |
Shared options #
cleanup |
Clean up build artifacts from the Git working directory before the deployment — type: boolean |
run |
Commands to execute after the deployment finished successfully — type: string or array of strings |
Environment variables #
All options can be given as environment variables if prefixed with NETLIFY_
.
For example, auth
can be given as NETLIFY_AUTH=<auth>
.
Securing secrets #
Secret option values should be given as either encrypted strings in your build
configuration (.travis.yml
file) or environment variables in your repository
settings.
Environment variables can be set on the settings page of your repository, or
using travis env set
:
travis env set NETLIFY_AUTH <auth>
In order to encrypt option values when adding them to your .travis.yml
file
use travis encrypt
:
travis encrypt <auth>
Or use --add
to directly add it to your .travis.yml
file. Note that this command has to be run in your repository’s root directory:
travis encrypt --add deploy.auth <auth>
Deploying a specific directory #
To deploy a specific directory, use the dir
key:
deploy:
provider: netlify
# ⋮
dir: "_build/"
Pull Requests #
Note that pull request builds skip the deployment step altogether.