-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·52 lines (39 loc) · 826 Bytes
/
deploy.sh
File metadata and controls
executable file
·52 lines (39 loc) · 826 Bytes
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
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
REMOTE="git@github.com:broch/broch.github.io.git"
DEPLOY="public"
info() {
printf " \033[00;32m+\033[0m $1\n"
}
success() {
printf " \033[00;32m+\033[0m $1\n"
}
fail() {
printf " \033[0;31m-\033[0m $1\n"
exit
}
if [ ! -f "config.toml" ]; then
fail "not at root dir"
fi
rm -rf $DEPLOY
mkdir $DEPLOY
info "created $DEPLOY"
pushd $DEPLOY
git init -q
info "initialized git"
#git checkout -b site -q
#info "created site branch"
git remote add origin $REMOTE
info "set git remote"
git fetch origin site
git checkout site
info "checked out site"
success "setup complete"
popd
hugo --minify --environment production
pushd $DEPLOY
git add --all .
info "added files to git"
git commit -m "Deploy" -q
info "committed site"
popd
echo "cd $DEPLOY squash, and force push site branch to deploy"