-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
43 lines (31 loc) · 864 Bytes
/
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
35
36
37
38
39
40
41
42
43
#!/bin/sh
# Cleanup (for those who don't use a CI).
rm -rf public
# Clone original repository.
git clone $(git remote get-url origin) public
# Attempt to switch to the deployment branch.
cd public/
# Who am I?
git config user.email "${GIT_USER_EMAIL}"
git config user.name "${GIT_USER_NAME}"
git checkout gh-pages
if [ 0 != $? ]; then
# Create a new orphan branch to track deployments
git checkout --orphan gh-pages
# Everything is being tracked, so remove it
git rm --cached -r ./
# Use special ignore for deploy.
mv .satisignore .gitignore
fi
# Build static `composer` repository with `composer/satis`.
cd ..
composer run-script install-deps
composer run-script build
# Deploy to Github Pages.
cd public/
git add --all
git commit -m "Deploy Satis"
git push -f origin gh-pages
# Cleanup (for those who don't use a CI).
cd ..
rm -rf public