mirror of
https://github.com/radareorg/blog.git
synced 2026-11-07 06:25:58 -10:00
Add building script
This commit is contained in:
1 parent
feeca30790
commit
44da4d6a99
1 file changed
+30
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
UPSTREAM=origin
|
||||
|
||||
if [ "`git status -s`" ]
|
||||
then
|
||||
echo "The working directory is dirty. Please commit any pending changes."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "Deleting old publication"
|
||||
rm -rf public
|
||||
mkdir public
|
||||
git worktree prune
|
||||
rm -rf .git/worktrees/public/
|
||||
|
||||
echo "Checking out gh-pages branch into public"
|
||||
git worktree add -B gh-pages public "${UPSTREAM}/gh-pages"
|
||||
|
||||
echo "Removing existing files"
|
||||
rm -rf public/*
|
||||
|
||||
echo "Generating site"
|
||||
hugo
|
||||
|
||||
echo "Updating gh-pages branch"
|
||||
cd public && git add --all && git commit -m "Publishing to gh-pages (publish.sh)"
|
||||
|
||||
#echo "Pushing to github"
|
||||
#git push --all
|
||||
Reference in new issue
Block a user