The “Deploy to Netlify” button helps users deploy new sites from templates with one single click. It provides web developers to a simple one-click step to let their users deploy those applications on Netlify.
It’s designed to be used in README files, documentation sites, and probably anything that renders as an html file.
This is an example of how it looks:
You can use any markup language that renders as HTML to display the button. There are two very important URLs that you’ll need:
- The SVG url for the button:
- The link where the button takes your users to:
https://app.netlify.com/start/deploy. This link requires the git repository as a parameter, for example:
To help you with our favourite markup languages, just enter the git repository address in the box below and we’ll create the code in different formats:
You can provide a set of default values for your template directly in the template’s git repository. Create a
netlify.toml file in the base of the repository, if you don’t have it already. We’ll read the information from there. This file can also be used to set options for continuous deployment, you can read more about it in the deploy contexts documentation
[template] section in that file, you can set two directives:
- A list of incoming hooks for the users site. This is very useful if you want to allow a third party service to control when to deploy the site. This is what headless CMS services like Contentful and DatoCMS do. Users can give those providers the address Netlify generates for their specific incoming requests.
[template] incoming-hooks = ["Contentful"]
- A list of required environment variables. This is the way to let users configure specific configuration options upon deployment. It also enables customization without having to change the code of the base template.
[template.environment] SECRET_TOKEN = "change me for your secret token" CUSTOM_LOGO = "set the url to your custom logo here"
Notice something is incorrect or outdated?
First off, great eye! We appreciate your discovery and want to ensure it gets addressed immediately. Please let us know here.