Skip to content

Instantly share code, notes, and snippets.

@steffencrespo
Created November 6, 2017 15:53
Show Gist options
  • Save steffencrespo/679072e95936e5f50980f88e5d3523f8 to your computer and use it in GitHub Desktop.
Save steffencrespo/679072e95936e5f50980f88e5d3523f8 to your computer and use it in GitHub Desktop.
Deploying with Netlify
(https://courses.thinkful.com/react-001v3/assignment/1.4.1)
Deploy to Netlify:
SETUP
-(npm install -g netlify-cli if not yet installed)
-set all the requests to be routed to index.html: in the public folder, add a _redirects file with /* /index.html 200 in it
-run npm run build
-run netlify create (then get the site id that is stored into the .netlify file.
-add .netlify to gitignore (echo ".netlify" >> .gitignore)
-get the .netlify access token by running 'cat ~/.netlify/config’
DEPLOY
-remember the access token from local .netlify/config file
-remember the site id from .netlify file
-run the command 'netlify deploy -p ./build -t <YOUR_ACCESS_TOKEN> -s <YOUR_SITE_ID>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment