aboutsummaryrefslogtreecommitdiff
path: root/deploy.sh
blob: 1e15d5710af86e7854c674c46ec755418ae0b772 (plain)
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/sh

if [ "$1" = "dev" ]; then
    branch=dev
    location='/var/www/html-test'
elif [ "$1" = "prod" ]; then
    branch=main
    location='/var/www/html'
fi

cd ~/website || exit
git checkout "$branch"
git pull

cd ~/.dotfiles || exit
git checkout "$branch"
git pull

cd ~/blog || exit
git checkout "$branch"
git pull

cd ~/.dotfiles || exit
~/website/fix-dotfile-paths.sh
emacs --batch -f package-initialize --script ~/website/publish.el
~/website/post-publish.sh

cp -r public_html/* "$location"