forked from sagemath/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·27 lines (23 loc) · 793 Bytes
/
publish.sh
File metadata and controls
executable file
·27 lines (23 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# After the website has been built successfully, it is in the "www" subdirectory.
# This script synchronizes this build with the Git repository at GitHub.
# From there, the website is served.
set -e
# assuming, this directory is beneath the /www directory and cd-ing there
cd `dirname "$0"`
if [ ! -d "www.git" ]; then
mkdir www.git
cd www.git
git init --bare
git remote add github git@github.com:sagemath/sagemath.github.io.git
cd ..
fi
cd www
GIT='git --git-dir=../www.git --work-tree=.'
# now getting the info from the repository to only see the new chances
$GIT fetch github
$GIT checkout -B master
$GIT reset --soft github/master # <- non destructive
$GIT add -A -- .
$GIT commit -m "auto publish `date -u --rfc-3339=seconds`"
$GIT push github master -f