Skip to content

Commit

Permalink
Merge pull request #8 from techlahoma/vl/gh-pages
Browse files Browse the repository at this point in the history
Add script for GH Pages deploy
  • Loading branch information
vlucas committed May 17, 2024
2 parents 9301a06 + 6c68287 commit 4820f9c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Binary file removed .DS_Store
Binary file not shown.
Empty file added .nojekyll
Empty file.
27 changes: 27 additions & 0 deletions scripts/deploy.sh
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

0 comments on commit 4820f9c

Please sign in to comment.