forked from SeleniumHQ/seleniumhq.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·28 lines (25 loc) · 1.09 KB
/
deploy.sh
File metadata and controls
executable file
·28 lines (25 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
if git --no-pager log -1 --oneline | grep "\\[deploy site\\]"; then
echo -e "\033[0;32mDeploying Selenium site to GitHub...\033[0m"
if [ -n "$GITHUB_AUTH_SECRET" ]
then
echo -e "\033[0;32mAdding Selenium CI Bot credentials...\033[0m"
touch ~/.git-credentials
chmod 0600 ~/.git-credentials
echo $GITHUB_AUTH_SECRET > ~/.git-credentials
git config credential.helper store
git config user.email "selenium-ci@users.noreply.github.com"
git config user.name "Selenium CI Bot"
fi
git remote add github "https://selenium-ci:${GITHUB_AUTH_SECRET}@github.com/SeleniumHQ/seleniumhq.github.io.git"
git fetch github
# git stash save || true
git checkout -t github/master -b github/master
git pull
chmod +x "$TRAVIS_BUILD_DIR"/build-site.sh && "$TRAVIS_BUILD_DIR"/build-site.sh
git add .
git commit -m "Deploying on $(date), commit ${TRAVIS_COMMIT}, [skip ci]" || true
git push github HEAD:master
else
echo -e "\033[0;32mCommit to master did not trigger deployment, add [deploy site] to the commit message if you intend to deploy...\033[0m"
fi