Skip to content

Instantly share code, notes, and snippets.

@mrvnmchm
Created December 4, 2019 05:11
Show Gist options
  • Save mrvnmchm/f76cbf86e195b427c0f4abc13cf7fc4a to your computer and use it in GitHub Desktop.
Save mrvnmchm/f76cbf86e195b427c0f4abc13cf7fc4a to your computer and use it in GitHub Desktop.
[Git Push] Push to git shell script #sh #git #ci-cd
#!/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