How do I create a deploy git branch for my Yeoman project?

169 views Asked by At

I created a new project using Yeoman. Using Grunt I've created the dist directory. My whole project is on Github, https://github.com/d3a1i0/mykungfuisstrong.com, and I've created a prod branch. My question is how do I get my prod branch to have only the contents of dist instead of having the dist directory and it's contents. That way when I work on the master and I want to deploy I can just commit the new changes to the prod branch. I'm trying to do this so I can set up grunt-build-control which I may have more questions about at another time.

1

There are 1 answers

0
Xavier Priour On BEST ANSWER

From the doc of grunt-build-control, the point of the task is that you don't need to worry about it. The task expects a full branch that compiles to a build folder, and will handle the rest for you: building, then commiting the result to a local branch - and then pushing to the proper repo (like a Heroku deploy repo) if you wish to.

If you just want to commit to a branch, and it is called prod, your Gruntfile would be:

buildcontrol: {
    options: {
        dir: 'dist',
        commit: true,
        push: true,
        message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
    },
    build: {
        options: {
            remote: '../',
            branch: 'prod'
        }
    }
}

Then you would call grunt buildcontrol:build