You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

netlify.md 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. +++
  2. title = "Netlify"
  3. weight = 20
  4. +++
  5. Netlify provides best practices like SSL, CDN distribution, caching and continuous deployment
  6. with no effort. This very site is hosted by Netlify and automatically deployed on commits.
  7. If you don't have an account with Netlify, you can [sign up](https://app.netlify.com) for one.
  8. Once you are in the admin interface, you can add a site from a Git provider (GitHub, GitLab or Bitbucket). At the end
  9. of this process, you can select the deploy settings for the project:
  10. - build command: `GUTENBERG_VERSION=0.3.1 gutenberg build` (replace the version number in the variable by the version you want to use)
  11. - publish directory: the path to where the `public` directory is
  12. With this setup, your site should be automatically deployed on every commit on master.
  13. However, if you want to use everything that Netlify gives you, you should also publish temporary sites for pull requests.
  14. This is done by adding the following `netlify.toml` file in your repository and removing the build command/publish directory in
  15. the admin interface.
  16. ```toml
  17. [build]
  18. # assuming the gutenberg site is in a docs folder, if it isn't you don't need
  19. # to have a `base` variable but you do need the `publish` and `command`
  20. base = "docs"
  21. publish = "docs/public"
  22. command = "gutenberg build"
  23. [build.environment]
  24. # Set the version name that you want to use and Netlify will automatically use it
  25. GUTENBERG_VERSION = "0.3.3"
  26. # The magic for deploying previews of branches
  27. # We need to override the base url with whatever url Netlify assigns to our
  28. # preview site. We do this using the Netlify environment variable
  29. # `$DEPLOY_PRIME_URL`.
  30. [context.deploy-preview]
  31. command = "gutenberg build --base-url $DEPLOY_PRIME_URL"
  32. ```