Skip to content

Commit ce24dec

Browse files
committed
Publish script
1 parent c13e5f8 commit ce24dec

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Site build directory
2+
public/

publish.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
BUILD_DIR=public
4+
PUBLISH_URL="https://harwellsoftwarecommunity.github.io/"
5+
6+
echo "Removing old build directory"
7+
rm -rf ${BUILD_DIR}
8+
9+
echo "Building site"
10+
hugo -d ${BUILD_DIR} -b ${PUBLISH_URL}
11+
12+
echo "Commit built site"
13+
cd ${BUILD_DIR}
14+
git init
15+
git add .
16+
git commit -m "Build from publish.sh script"
17+
18+
echo "Push to remote"
19+
git remote add github "[email protected]:HarwellSoftwareCommunity/harwellsoftwarecommunity.github.io.git"
20+
git push github --force

0 commit comments

Comments
 (0)