-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from techlahoma/vl/gh-pages
Add script for GH Pages deploy
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
GIT_BRANCH=$(git symbolic-ref -q HEAD) | ||
GIT_REPO_URL=$(git config --get remote.origin.url) | ||
BUILD_FOLDER=".build" | ||
|
||
# Build | ||
# npm run build | ||
|
||
# Deploy & setup | ||
cd $BUILD_FOLDER | ||
rm .DS_Store | ||
git init . | ||
git remote add origin $GIT_REPO_URL | ||
git checkout -b gh-pages || (echo "Cannot chekout gh-pages branch!" && exit 1) | ||
# git pull origin gh-pages --rebase || (echo "Unable to pull remote changes on gh-pages branch!" && exit 1) | ||
|
||
# Add CNAME file if present | ||
cp ../CNAME . | ||
|
||
# Ensure static assets can be served properly | ||
touch .nojekyll | ||
|
||
git add . | ||
git commit -am "Static site deploy" | ||
git push origin gh-pages --force | ||
cd .. | ||
rm -rf $BUILD_FOLDER |