Created
December 4, 2019 05:11
-
-
Save mrvnmchm/f76cbf86e195b427c0f4abc13cf7fc4a to your computer and use it in GitHub Desktop.
[Git Push] Push to git shell script #sh #git #ci-cd
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
#!/bin/sh | |
setup_git() { | |
git config --global user.email "travis@travis-ci.org" | |
git config --global user.name "Travis CI" | |
} | |
commit_website_files() { | |
git checkout -b my-new-branch | |
git add . | |
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" | |
} | |
upload_files() { | |
git remote add origin-pages https://${GH_TOKEN}@github.com/my-new-project/resources.git > /dev/null 2>&1 | |
git push --quiet --set-upstream origin-pages gh-pages | |
} | |
setup_git | |
commit_website_files | |
upload_files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment