Skip to content

Commit 42d8e4e

Browse files
committed
Update deploy script
1 parent 0810948 commit 42d8e4e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

bin/travis-deploy-to-gh-pages.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ if [ "$SITE_DOMAIN" != "" ]; then
1616
echo $SITE_DOMAIN > CNAME
1717
fi
1818

19+
# sed all outputs so that $GITHUB_ACCESS_TOKEN can be removed from output
20+
1921
# Add github as remote
20-
git remote add github "https://$GITHUB_ACCESS_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
22+
{ git remote add github "https://$GITHUB_ACCESS_TOKEN@github.com/$TRAVIS_REPO_SLUG.git" 2>&1; } | \
23+
sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g"
2124

2225
# and add all files
23-
git add -A
26+
{ git add -A 2>&1; } | sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g"
2427

2528
# Commit all files
26-
git commit -am "Builded gh-pages from $TRAVIS_BRANCH in Travis CI\nCommit-ID:$TRAVIS_COMMIT"
29+
{ git commit -am "Builded gh-pages from $TRAVIS_BRANCH in Travis CI\nCommit-ID:$TRAVIS_COMMIT" 2>&1; } | \
30+
sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g"
2731

2832
# Push current master branch as gh-pages into github
29-
# Don't output anything so that $GITHUB_ACCESS_TOKEN won't go into the logs
30-
echo "Pushing to https://github.com/$TRAVIS_REPO_SLUG quietly"
31-
git push github $TRAVIS_BRANCH:$TRAVIS_DEPLOY_BRANCH --force --quiet
33+
{ git push github $TRAVIS_BRANCH:$TRAVIS_DEPLOY_BRANCH --force 2>&1; } | \
34+
sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g"

0 commit comments

Comments
 (0)