Coder Social home page Coder Social logo

osxi / ember-cli-github-pages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from poetic/ember-cli-github-pages

0.0 3.0 0.0 353 KB

Easily manage gh-pages of your ember-cli addon

License: MIT License

JavaScript 80.24% HTML 18.94% CSS 0.31% Handlebars 0.51%

ember-cli-github-pages's Introduction

ember-cli-github-pages

npm version Ember Observer Score Code Climate Dependency Status devDependency Status

If you need to throw up a quick example of your addon in action, this is the addon for you!

This addon provides new command(s) to help manage a gh-pages branch for your addon. It's an addon for addons.

Installation & Setup

First you need to install ember-cli-github-pages:

ember-cli - 0.2.3 or newer

ember install ember-cli-github-pages

ember-cli - 0.1.5 to 0.2.3

ember install:addon ember-cli-github-pages

ember-cli - 0.1.4 and below

npm install --save-dev ember-cli-github-pages
ember generate ember-cli-github-pages

Then you need to make the sure gh-pages branch is created and the unnecessary files are removed:

git checkout --orphan gh-pages && rm -rf `ls -a | grep -vE '.gitignore|.git|node_modules|bower_components|\.\/|\.\.\/'` && git add . && git commit -m "initial gh-pages commit"

Usage

Once that's done, you can checkout the branch you want to create the gh-page from(likely master) and run the command to build and commit it.

Then run ember github-pages:commit --message "some commit message" in order to rebuild gh-pages branch.

git checkout master
ember github-pages:commit --message "Initial gh-pages release"

A note about Org and User Pages

While in general, github repo pages will serve the content in the gh-pages branch, org and user pages serve content in the master branch. When using this addon to develop a Org or User page, edit your Ember Application on an alternate branch such as ember. Once you are ready to build the application and send to GitHub you can either:

  • add the --branch master option to the ember github-pages:commit command
  • make the gh-pages branch on your local machine track the master branch on origin via the command:
git branch --set-upstream gh-pages origin/master

Advanced Usage

You may optionally specify an ember build environment and a branch name as parameters

git checkout master
ember github-pages:commit --message "Initial demo app release" \
                          --branch="my-demo-app" \
                          --environment=development
Optional Argument Default Value Description
environment production Ember build environment (i.e., development, production)
branch gh-pages Branch to commit your app to

Important

In order to have any assets you have in your repo load correctly you need to add the following to your tests/dummy/config/environment.js file:

if (environment === 'production') {
  ENV.baseURL = '/name-of-your-repo'
}

You will still need to push the gh-pages branch up to github using git. Once you do that you can access the repo at http://username.github.io/repo-name. It may take a few minutes after pushing the code to show up.

Authors

We are very thankful for our many contributors

Legal

Licensed under the MIT license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.