Skip to content

Commit

Permalink
Updated .travis.yml to add GA code to GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Mar 31, 2017
1 parent 7276cca commit 3788a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ script:
- grunt docs
- grunt node
- grunt prod
before_deploy:
- grunt copy:ghPages
deploy:
- provider: pages
skip_cleanup: true
Expand Down
16 changes: 1 addition & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ module.exports = function (grunt) {
"Creates a production-ready build. Use the --msg flag to add a compile message.",
["eslint", "clean:prod", "webpack:webProd", "inline", "chmod"]);

grunt.registerTask("release",
"Prepares and deploys a production version of CyberChef to the gh-pages branch.",
["copy:ghPages", "exec:deployGhPages"]);

grunt.registerTask("default",
"Lints the code base",
["eslint", "exec:repoSize"]);
Expand Down Expand Up @@ -295,7 +291,7 @@ module.exports = function (grunt) {
process: function (content, srcpath) {
// Add Google Analytics code to index.html
content = content.replace("</body></html>",
grunt.file.read("src/static/ga.html") + "</body></html>");
grunt.file.read("src/web/static/ga.html") + "</body></html>");
return grunt.template.process(content);
}
},
Expand Down Expand Up @@ -328,16 +324,6 @@ module.exports = function (grunt) {
cleanGit: {
command: "git gc --prune=now --aggressive"
},
deployGhPages: {
command: [
"git add build/prod/index.html -v",
"COMMIT_HASH=$(git rev-parse HEAD)",
"git commit -m \"GitHub Pages release for ${COMMIT_HASH}\"",
"git push origin `git subtree split --prefix build/prod master`:gh-pages --force",
"git reset HEAD~",
"git checkout build/prod/index.html"
].join(";")
}
},
execute: {
test: "build/test/index.js"
Expand Down

0 comments on commit 3788a91

Please sign in to comment.