deploy 588 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

echo -e "\033[0;32mDeploying updates to GitLab and Dokku...\033[0m"

# Commit changes.
msg="rebuilding site `date`"
if [ $# -eq 1 ]
  then msg="$1"
fi

git add .
git commit -m "pre $msg"

# Build the project.
15
16
cd public && \
  git checkout master && \
jon r's avatar
jon r committed
17
  git branch -u origin \
18
  cd -
19
rm -rf public/*
20
21
22
23
24
25
26
27
28
29
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`

# Go To Public folder
cd public
# Add changes to git.
git add .

git commit -m "$msg"

# Push source and build repos.
30
git push
31

32
33
34
35
36
37
# Come Back up to the Project Root
cd ..

git add .
git commit -m "post $msg"
git push