I have been relentlessly practicing this new Git deploy workflow to demonstrate it at my upcoming talk at WordCamp LAX. This is what I have and please let me know if I am making any errors or being redundant. I am primarily a designer and front-end developer, so I am learning as I go along with a lot of these new technologies Roots has been adopting.
###Services/Software used
- Terminal
- github.com
- Github for Mac (desktop GUI for git)
- Sublime Text
- MAMP
- Deploy (deployment from git repositories)
For the purposes of this example, I am renaming the theme as ‘demo’.
####Part I: Github setup
- Create a repository at github.com named ‘demo’
- Clone Roots repository from github.com to desktop as ‘demo’
- Change local Roots clone settings as follows:
- Change Primary remote repository (origin) to: https://github.com/shaimoom/demo.git (from github.com repo)
- Delete the following from Ignored files (.gitignore):
assets/css/*main*.cssassets/js/*scripts*.jsassets/js/vendor/modernizr.min.jsassets/manifest.json
- Sync the local and remote repositories (initial commit)
####Part II: Local Dev Setup, Install Dependencies & Grunt
- Add
define('WP_ENV', 'development');to the WordPress installationwp-config.php
- Right-click on the ‘demo’ repository in Github and select ‘Open in Terminal’
- Run
npm installon theme root directory (vendor assets will be added to the theme) - Run
grunt watchon theme root directory in terminal to track changes - Activate theme
- Customize theme
####Part III: Deployment
- Remove
define('WP_ENV', 'development');in the WordPress installationwp-config.php
- Run
grunt buildand commit in Github (minified assets will be generated for production) - Add SSH & SFTP info to Deploy (including theme file path)
- Deploy from latest commit
- Activate theme on production site
- Win?
Repeat Part II and Part III during local development.
Your comments are appreciated.