Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Commit

Permalink
Add deploy task to send files to gh-pages branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno Rocha committed Apr 26, 2014
1 parent a0a93e3 commit c817fef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
34 changes: 16 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
module.exports = function(grunt) {

grunt.initConfig({
connect: {
'connect': {
demo: {
options: {
open: true,
keepalive: true
}
}
},
replace: {
'gh-pages': {
options: {
clone: 'bower_components/hello-world-polymer'
},
src: [
'bower_components/**/*',
'!bower_components/hello-world-polymer/**/*',
'src/*', 'index.html'
]
},
'replace': {
example: {
src: ['src/*'],
dest: 'dist/',
Expand All @@ -18,27 +28,15 @@ module.exports = function(grunt) {
to: '..'
}]
}
},
bump: {
options: {
commit: true,
commitFiles: ['bower.json', 'package.json'],
commitMessage: 'Release v%VERSION%',
createTag: true,
files: ['bower.json', 'package.json'],
push: true,
pushTo: 'origin gh-pages',
tagMessage: '',
tagName: 'v%VERSION%'
}
}
});

grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-text-replace');

grunt.registerTask('default', ['connect']);
grunt.registerTask('build', ['replace']);
grunt.registerTask('build', ['replace']);
grunt.registerTask('deploy', ['gh-pages']);
grunt.registerTask('server', ['connect']);

};
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Install the component using [Bower](http://bower.io/):
$ bower install hello-world-polymer --save
```

Or [download as ZIP](https://github.com/webcomponents/hello-world-polymer/archive/gh-pages.zip).
Or [download as ZIP](https://github.com/webcomponents/hello-world-polymer/archive/master.zip).

## Usage

Expand Down Expand Up @@ -63,17 +63,19 @@ In order to run it locally you'll need to fetch some dependencies and a basic se
3. To test your project, start the development server and open `http://localhost:8000`.

```sh
$ grunt
$ grunt server
```

4. To publish a new version, build the distribution files, bump package version, create tag, commit and push.
4. To build the distribution files before releasing a new version.

```sh
$ grunt build
```

5. To provide a live demo, send everything to `gh-pages` branch.

$ grunt bump # v0.0.1
$ grunt bump:minor # v0.1.0
$ grunt bump:major # v1.0.0
```sh
$ grunt deploy
```

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"private": true,
"devDependencies": {
"grunt": "~0.4.1",
"grunt-bump": "~0.0.13",
"grunt-cli": "~0.1.9",
"grunt-contrib-connect": "~0.7.1",
"grunt-gh-pages": "~0.9.1",
"grunt-text-replace": "~0.3.11"
}
}

0 comments on commit c817fef

Please sign in to comment.