> For the complete documentation index, see [llms.txt](https://cansahin.gitbook.io/react-boilerplate-cra-template/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cansahin.gitbook.io/react-boilerplate-cra-template/deployment/netlify.md).

# Netlify

## Easy 5-Step Deployment Process

*Step 1:* Create a `netlify.toml` file in the root directory of your project and copy this code below. Edit these settings if you did not follow the boilerplate structure. More settings available here (<https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file>)

```
[build]
  # Directory to change to before starting a build.
  # This is where we will look for package.json/.nvmrc/etc.
  base = "/"

  # Directory (relative to root of your repo) that contains the deploy-ready
  # HTML files and assets generated by the build. If a base directory has
  # been specified, include it in the publish directory path.
  publish = "./build"

  # Default build command.
  command = "yarn run build"

# The following redirect is intended for use with most SPAs that handle routing internally.
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
```

*Step 2:* Commit your code and push your latest updates to a GitHub repository.

*Step 3:* Register or Login in at [Netlify](https://app.netlify.com/).

*Step 4:* In your account | team page click `New site from git` then chose your repository.

*Step 5:* Click deploy.

{% hint style="info" %}
Note: No need to change any setting in the last step as `netlify.toml` overwrites these settings.
{% endhint %}

Now your code will be deployed automatically to Netlify on every push to the default branch of your repository.🥳🥳
