mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Updated .travis.yml to add GA code to GH Pages
This commit is contained in:
parent
7276ccaf96
commit
3788a9161a
2 changed files with 3 additions and 15 deletions
|
@ -10,6 +10,8 @@ script:
|
||||||
- grunt docs
|
- grunt docs
|
||||||
- grunt node
|
- grunt node
|
||||||
- grunt prod
|
- grunt prod
|
||||||
|
before_deploy:
|
||||||
|
- grunt copy:ghPages
|
||||||
deploy:
|
deploy:
|
||||||
- provider: pages
|
- provider: pages
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
|
16
Gruntfile.js
16
Gruntfile.js
|
@ -28,10 +28,6 @@ module.exports = function (grunt) {
|
||||||
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
"Creates a production-ready build. Use the --msg flag to add a compile message.",
|
||||||
["eslint", "clean:prod", "webpack:webProd", "inline", "chmod"]);
|
["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",
|
grunt.registerTask("default",
|
||||||
"Lints the code base",
|
"Lints the code base",
|
||||||
["eslint", "exec:repoSize"]);
|
["eslint", "exec:repoSize"]);
|
||||||
|
@ -295,7 +291,7 @@ module.exports = function (grunt) {
|
||||||
process: function (content, srcpath) {
|
process: function (content, srcpath) {
|
||||||
// Add Google Analytics code to index.html
|
// Add Google Analytics code to index.html
|
||||||
content = content.replace("</body></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);
|
return grunt.template.process(content);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -328,16 +324,6 @@ module.exports = function (grunt) {
|
||||||
cleanGit: {
|
cleanGit: {
|
||||||
command: "git gc --prune=now --aggressive"
|
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: {
|
execute: {
|
||||||
test: "build/test/index.js"
|
test: "build/test/index.js"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue