Skip to content

Commit cc45998

Browse files
committed
Add a deploy script.
This follows the Hugo deploy guide for GitHub Pages, https://gohugo.io/hosting-and-deployment/hosting-on-github/#step-by-step-instructions
1 parent 3795e1f commit cc45998

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
public/
21
resources/
32

43
*.swp
@@ -204,4 +203,4 @@ TAGS
204203

205204
# Files generated when a patch is rejected
206205
*.orig
207-
*.rej
206+
*.rej

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[submodule "themes/hugo-fresh"]
22
path = themes/hugo-fresh
33
url = https://github.com/StefMa/hugo-fresh.git
4+
[submodule "public"]
5+
path = public
6+
url = [email protected]:numpy/numpy.github.com.git
7+
branch = master

deploy.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
# If a command fails then the deploy stops
4+
set -e
5+
6+
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n"
7+
8+
# Build the project.
9+
hugo
10+
11+
# Go To Public folder
12+
cd public
13+
14+
# Add changes to git.
15+
git add .
16+
17+
# Commit changes.
18+
msg="rebuilding site $(date)"
19+
if [ -n "$*" ]; then
20+
msg="$*"
21+
fi
22+
git commit -m "$msg"
23+
24+
# Push source and build repos.
25+
git push origin master

public

Submodule public added at e0ed430

0 commit comments

Comments
 (0)