apreshill / armed

https://armed.netlify.com/
0 stars 0 forks source link

use travis to build your book and deploy it to netlify #1

Open apreshill opened 5 years ago

apreshill commented 5 years ago

Hereafter, approach # 1: Happy Git approach (manual deploy, requires using Netlify CLI locally)

Basics:

  1. Made my book

  2. updated my .gitignore to include: _book _bookdown_files

  3. Copied Jenny's .travis.yml

  4. ~~added .RBuildignore ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$~~

  5. configured travis for repo via GitHub

  6. followed netlify cli here in terminal

    brew install node # install nodejs first via homebrew
    npm install netlify-cli -g # then install cli for netlify
    netlify login # via browser pop-up
  7. Obtain a Token in the Netlify UI

  8. In Travis:

    • enable continuous integration for your book’s GitHub repo on Travis
    • save the Netlify token from previous step as a NETLIFY_AUTH_TOKEN environment variable.
  9. did manual deploy setup in terminal with netlify cli to update .travis.yml

    netlify init --manual
    env:
       - NETLIFY_SITE_ID=8d3ac697-172f-4abe-9caf-09a4e81b9d42
  10. this added .netlify/state.json to my repo for me

    {
          "siteId": "8d3ac697-172f-4abe-9caf-09a4e81b9d42"
    }
  11. but then added .netlify to .gitignore

  12. add DESCRIPTION

  13. push to github and hold breath

  14. log onto netlify and see my site there, it says manual deploys

  15. do this through Netlify UI

    screen shot 2019-01-04 at 10 40 46 am
  16. Note that in Netlify UI "build settings" are empty ("not set" for base and build directories, and "." for publish directory)

apreshill commented 5 years ago

This pertains to step 9 above:

Alisons-MacBook-Pro:armed alison$ netlify init --manual
? What would you like to do? +  Create & configure a new site
Choose a site name or leave blank for a random name. You can update later.
? Site name (optional): armed
? Account: Alison Presmanes Hill  (personal)

Site Created

Admin URL: https://app.netlify.com/sites/armed
URL:       https://armed.netlify.com
Site ID:   8d3ac697-172f-4abe-9caf-09a4e81b9d42

Give this Netlify SSH public key access to your repository:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxtMENi56ruhFK5/8BSw871NMvpdU+r5JKF2F3c3RhRdx/uE5eJXf+4ZORpZpR0JRtkU0piW49SyXHxzklajijCr6PoY+snetlHnJpUeuy2oq7YG4IpKRCCMjwfUZ8IuBQcKpRwQyG9TA1slRjLQkMteW6AsSr/0+1E2G2fVIagPbnfbV/752B/z3H0I/vxVJwOPnIWJcdzEZ8q7vxUTy2Td4Av5bpsMObn75B4axRsRLzoTCt01WcuQcPYZzBwLsdmkTUmpO1m1RqLGKj8gxCpOURcm+yJYofKdKlk5VJVOOyS5WZ+0W1F2Irn9iNUdWGYoxurJ6dQYluA2LZfF57

? Continue? Yes
? Your build command (hugo build/yarn run build/etc): undefined
? Directory to deploy (blank for current dir): .

Configure the following webhook for your repository:

https://api.netlify.com/hooks/5c2fdd6d220c45ff53d7f7f9

? Continue? Yes

Netlify CI/CD Configured!

This site is now configured to automatically deploy from manual branches & pull requests

Next steps:

  git push       Push to your git repository to trigger new site builds
  netlify open   Open the netlify admin url of your site

Alisons-MacBook-Pro:armed alison$