-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·33 lines (27 loc) · 1.02 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
#!/bin/bash
# Unpack secrets; -C ensures they unpack *in* the .travis directory
tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent:
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults:
git config --global user.email "[email protected]"
git config --global user.name "gong023"
# Add SSH-based remote to GitHub repo:
git remote add deploy [email protected]:gong023/namae-space.git
git fetch deploy
# Get box and build PHAR
curl -LSs https://box-project.github.io/box2/installer.php | php
./box.phar build -vv
# Without the following step, we cannot checkout the gh-pages branch due to
# file conflicts:
mv namaespace.phar namaespace.phar.tmp
# Checkout gh-pages and add PHAR file and version:
git checkout -b gh-pages deploy/gh-pages
mv namaespace.phar.tmp namaespace.phar
sha1sum namaespace.phar > namaespace.phar.version
git add namaespace.phar namaespace.phar.version
# Commit and push:
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages