Skip to content

Commit

Permalink
add npm scripts to build and deploy website
Browse files Browse the repository at this point in the history
  * commit built website to website/
  • Loading branch information
bantic committed Jul 9, 2015
1 parent d7705e5 commit 205f169
Show file tree
Hide file tree
Showing 14 changed files with 14,373 additions and 2 deletions.
21 changes: 21 additions & 0 deletions bin/build-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

echo "Building website..."
npm run build

echo "Arranging built website in website/"
rm -rf website
mkdir website

# rename demo/website-index.html to be the base index.html
cp dist/demo/website-index.html website/index.hml

# selectively copy asset dirs from dist to the staging area
cp -R dist/demo website/demo
cp -R dist/css website/css
cp -R dist/global website/global

CURRENT_SHA="$(git rev-parse HEAD)"
git add website/
git commit -m "built website from $CURRENT_SHA"
echo "Done."
3 changes: 3 additions & 0 deletions bin/deploy-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

git push origin `git subtree split --prefix website`:gh-pages --force
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>ContentKit Editor</title>
<title>Content Kit Editor Demo 0.2.0</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">

<!-- Include ContentKit-Editor CSS -->
Expand Down
10 changes: 10 additions & 0 deletions demo/website-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Content Kit Editor 0.2.0</title>
</head>
<body>
<!-- This file is here so that bustlelabs.github.io/content-kit-editor/ can direct the visitor to /demo -->
Click to view the <a href="./demo/index.html">Demo</a>.
</body>
</html>
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"scripts": {
"start": "broccoli serve",
"test": "testem ci",
"build": "rm -rf dist && broccoli build dist"
"build": "rm -rf dist && broccoli build dist",
"build-website": "./bin/build-website.sh",
"deploy-website": "./bin/deploy-website.sh"
},
"keywords": [
"html",
Expand Down
Loading

0 comments on commit 205f169

Please sign in to comment.