Newbie question: How to deploy Roots

Thanks @asuh and @kalenjohnson. I look forward to seeing you there. I have streamlined the process by using this Gruntfile.js instead, so that grunt watch also builds the minified assets (thanks @cfx). No more fiddling with define('WP_ENV', 'development'); The modified Gruntfile.js also activates LiveReload if one is so inclined. Here is my revised writeup with the new file.

##Services/Software used

For the purposes of this example, I am renaming the theme as ‘demo’.

###Part I: Github setup

  1. Create a repository at github.com named ‘demo’
  • Clone Roots repository from github.com to wp-content/themes folder as ‘demo’
  • Change local Roots clone settings as follows:
    • Change Primary remote repository (origin) to: https://github.com/shaimoom/demo.git (you can find this at the github.com repo for ‘demo’)
    • Delete the following from Ignored files (.gitignore):
      • assets/css/*main*.css
      • assets/js/*scripts*.js
      • assets/js/vendor/modernizr.min.js
      • assets/manifest.json
  • Sync the local and remote repositories (initial commit)

###Part II: Local Dev Setup, Install Dependencies & Grunt

  1. Right-click on the ‘demo’ repository in Github and select ‘Open in Terminal’
  • Run npm install on theme root directory (vendor assets will be added to the theme)
  • Run grunt build (build minified assets to see Bootstrap styled theme upon theme activation)
  • Replace Gruntfile.js in theme root directory with this Gist (runs build task in watch task / activates LiveReload)
  • Run grunt watch on theme root directory in terminal to track changes and build minified assets
  • Activate LiveReload in Chrome Extensions
  • Activate theme
  • Activate theme on production site

###Part III: Deployment

  1. Make a change to local theme
  • Create a commit in Github and sync
  • Go to Deploy Add SSH & SFTP info (including theme file path)
  • Click ‘Deploy Now’ to deploy from latest commit
  • View changes deployed to production site

Repeat Part III to deploy local changes to production site (except step 3 - that is for setting up Deploy for the first time only).

3 Likes