Skip to content

Commit 0c61e6c

Browse files
committed
Fix GH Pages deployment issue with ignored files
1 parent 1f351bf commit 0c61e6c

File tree

5 files changed

+16
-144
lines changed

5 files changed

+16
-144
lines changed

examples/dist/index.html

Lines changed: 0 additions & 99 deletions
This file was deleted.

examples/dist/index.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/dist/style.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

gh-deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
VERSION="$(cat ./package.json | python -c "import sys, json; print(json.load(sys.stdin)['version'])")"
3+
git diff --exit-code
4+
5+
if [[ $? == 0 ]]
6+
then
7+
sed -i '\:/examples/dist:d' ./.gitignore
8+
git add .
9+
git commit -m "Publish v${VERSION} examples"
10+
git push origin `git subtree split --prefix examples/dist master`:gh-pages --force
11+
git reset HEAD~
12+
git checkout .gitignore
13+
else
14+
echo "Need clean working directory to publish"
15+
fi

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"scripts": {
2222
"build": "gulp build-no-css-compare",
2323
"examples": "gulp examples",
24-
"gh-build": "gulp build-gh-pages",
25-
"gh-deploy": "npm run gh-build && git subtree push --prefix examples/dist origin gh-pages",
24+
"gh-deploy": "gulp build-gh-pages && bash ./gh-deploy.sh",
2625
"prepublishOnly": "gulp build",
2726
"test": "gulp test-script"
2827
},

0 commit comments

Comments
 (0)