Skip to content

Instantly share code, notes, and snippets.

@grayghostvisuals
Created January 12, 2013 19:15
Show Gist options
  • Save grayghostvisuals/4520016 to your computer and use it in GitHub Desktop.
Save grayghostvisuals/4520016 to your computer and use it in GitHub Desktop.
Yeoman build automation for gh-page deployment.
# Description:
# Yeoman build automation for gh-page deployment.
#
# Credits:
# Made possible by @ChrisJeane and GrayGhostVisuals (@gryghostvisuals)
#
# How To:
# This Rakefile goes in the root directory outside of your
# yeoman project. after you've run 'yeoman build' you may then
# run 'rake build from your project's main root directory.
#
# Why?:
# In order to deploy to github pages your site must operate
# from the root directory. Since all your build files are
# placed in a 'dist' directory by yeoman we need to automate
# the process in order to move those 'dist' directory files
# into a root directory for gh-page deployment.
task :build do
Dir.chdir('yeoman') { `yeoman build` }
# Determines the build directory and ignores a folder you specifiy
Dir.glob('yeoman/dist/*') { |f| FileUtils.cp_r(f, '.', verbose: true) if f != "yeoman/dist/$IGNORE_THIS_FOLDER_NAME" }
# Makes sure to copy over the .htaccess file
FileUtils.copy("yeoman/dist/.htaccess", '.', verbose: true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment