forked from Chalarangelo/30-seconds-of-css
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Felix Wu
committed
Oct 5, 2018
1 parent
989c689
commit 7f5be68
Showing
3 changed files
with
52 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,16 @@ | ||
language: node_js | ||
node_js: | ||
- node | ||
install: | ||
- npm install | ||
script: | ||
- npm run build | ||
after_script: | ||
- test $TRAVIS_EVENT_TYPE = cron | ||
&& echo -e "\e[95mDeploying to Repository" | ||
&& chmod +x .travis/push.sh | ||
&& ./.travis/push.sh | ||
- chmod +x .travis/forcepush.sh && ./.travis/forcepush.sh | ||
cache: | ||
directories: | ||
- node_modules |
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,3 @@ | ||
if [[ $TRAVIS_COMMIT_MESSAGE == *"--force-build"* ]]; | ||
then echo -e "\e[95mFORCE-DEPLOY: Deploying to Repository" && chmod +x .travis/push.sh && ./.travis/push.sh; | ||
fi |
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,33 @@ | ||
#!/bin/bash | ||
setup_git() { | ||
git config --global user.email "30secondsofcode@gmail.com" | ||
git config --global user.name "30secondsofcode" | ||
} | ||
|
||
commit_website_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
echo "Committing to master branch..." | ||
git checkout master | ||
git add * | ||
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]" | ||
else | ||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [FORCED]" | ||
fi | ||
fi | ||
fi | ||
} | ||
|
||
upload_files() { | ||
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then | ||
if [ $TRAVIS_BRANCH == "master" ]; then | ||
echo "Pushing to master branch..." | ||
git push --force "https://${GH_TOKEN}@github.com/30-seconds/30-seconds-of-css.git" master > /dev/null 2>&1 | ||
fi | ||
fi | ||
} | ||
|
||
setup_git | ||
commit_website_files | ||
upload_files |