-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
6 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
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
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,24 @@ | ||
#!/bin/bash | ||
|
||
if [[ $# -ne 2 ]] ; then | ||
echo 'usage: tools/create-feature-branch <ticketnumber> <branchname>' | ||
echo | ||
echo 'examples: tools/create-feature-branch 1234 fancyfeature' | ||
echo ' tools/create-feature-branch 1234 "my fancy feature"' | ||
exit 1 | ||
fi | ||
|
||
echo "Fetching upstream" | ||
git fetch upstream --progress | ||
|
||
echo "Switching to main" | ||
git checkout upstream/main -B main | ||
if [ $? != 0 ]; then | ||
echo "Can't reset and checkout main" | ||
exit 1 | ||
fi | ||
|
||
echo "Creating feature branch from main" | ||
git checkout -b feature-$1-${2//[^a-zA-Z0-9]/_} main | ||
|
||
echo "Done" |
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,47 @@ | ||
#!/bin/bash | ||
|
||
# install deps & project build done | ||
# control comes here only if install and build goes fine | ||
# assumes 'docs' to be present in the main branch | ||
# assumes 'gh-pages' branch is present | ||
|
||
# set GitHub config credentials | ||
|
||
git config user.email "[email protected]" | ||
git config user.name "deployment-bot" | ||
|
||
# remove any changes by stashing | ||
# checkout to main | ||
|
||
git stash | ||
git checkout main | ||
|
||
# checkout to the gh-pages, reset | ||
# sync the branch with our main | ||
|
||
git checkout gh-pages | ||
git reset --hard origin/main | ||
|
||
# delete everything on the directory | ||
# ignore the docs folder | ||
|
||
find * -maxdepth 0 -not -name 'storybook-static' -exec rm -rf '{}' ';' | ||
|
||
# remove some folders additionally | ||
|
||
rm -rf .husky .storybook | ||
|
||
# move the docs folder content | ||
# explode in the repository root | ||
|
||
mv ./storybook-static/* . | ||
|
||
# deletes the git cache | ||
# push the new content to gh-pages | ||
|
||
git rm -rf --cache . | ||
git add . | ||
git commit -m "Deploy Storybook to GitHub pages" | ||
|
||
# force push to origin/gh-pages | ||
git push origin gh-pages --force |