Compare commits

...

3 Commits

Author SHA1 Message Date
steven c0f00bf301 draft(post-receive): production script
script for git to automatically build and deploy the websites upon pushing an update to the main branch stored on the production server
2021-09-15 15:52:37 -04:00
steven 620203f305 fix(gitignore): ignore hugo build output directory 2021-09-15 15:52:04 -04:00
steven bfafcd114f init(theme): mineral 2021-09-15 15:51:33 -04:00
13 changed files with 79 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.DS_Store
blog/public

View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2021 steven@mineral.town
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,2 @@
+++
+++

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -0,0 +1,12 @@
name = "mineral"
license = "MIT"
licenselink = "https://irie.clinic.homo.casa/steven-y-e/friends-of-mineral-town/src/branch/main/blog/themes/mineral/LICENSE"
description = "a theme for the blog for friends of mineral town"
homepage = "https://blog.mineral.town/"
tags = []
features = []
min_version = "0.41.0"
[author]
name = "steven"
homepage = "https://friends.of.mineral.town"

33
post-receive 100644
View File

@ -0,0 +1,33 @@
#!/bin/bash
# The production directory
TARGET="/var/www/friends.of.mineral.town"
# Local (to server) git repository
GIT_DIR="~/mineral.town.git"
# A temporary directory for deployment
TEMP="~/work"
# Name of production branch
BRANCH="main"
while read oldrev newrev ref
do
# only checking out the deployment branch
if [ "$ref" = "refs/heads/$BRANCH" ];
then
mkdir $TEMP
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TEMP --git-dir=$GIT_DIR checkout -f $BRANCH
# build blog
cd $TEMP/blog
hugo -D
# Replace production directory with updated project files
cd ~
rm -rf $TARGET
mv $TEMP/ $TARGET/
else
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
fi
done