forked from tc39/proposal-intl-segmenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·35 lines (26 loc) · 1.05 KB
/
deploy.sh
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
29
30
31
32
33
34
#!/bin/bash
set -ev
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
if [[ "$TRAVIS_BRANCH" != master ]]; then
echo "Skipping deploy; just doing a build."
npm run build
exit 0
fi
# Enable SSH authentication
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
if [[ $ENCRYPTED_KEY == "" ]]; then
echo "Auto-deploy GitHub key missing; exiting without a build"
exit 0
fi
$(npm bin)/set-up-ssh --key "$ENCRYPTED_KEY" \
--iv "$ENCRYPTED_IV" \
--path-encrypted-key "$PRIVATE_KEY_FILE_NAME"
# Update the content from the `gh-pages` branch
$(npm bin)/update-branch --commands "mkdir out && ecmarkup spec.html out/index.html" \
--commit-message "Update gh-pages [skip ci]" \
--directory "out" \
--distribution-branch "gh-pages" \
--source-branch "master"