Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ In order to build the site you will need `jekyll`, see instructions below to ins
Making changes to the site
=================

When making changes to the site, you should always work on the `source` branch. After committing your changes to `source`, simply run the `deploy.sh` script. This script will take care of the steps involved to push both the `source` and `master` branches to github.

./deploy.sh
When making changes to the site:
1. Start from the lastest version of the source branch with `git checkout source ; git pull`.
2. Create a new branch for your changes with `git checkout -b <mybranchname>`.
3. Commit your changes to the branch.
4. Push the changes to github using `git push --set-upstream origin <mybranchname>`.
5. Open a pull request (PR) for the branch on github at https://github.com/revbayes/revbayes.github.io
6. After the pull request is merged to the `source` branch on github, move back to the source branch locally with `git checkout source` and fetch the latest version with `git pull`.
7. Now you can run the `deploy.sh` script to update the `master` branch.

Pull requests for the website do not currently require review, so you can merge them yourself if checks pass.
These checks help to prevent the tutorials from breaking.

Setting up jekyll
=================
Expand Down
36 changes: 26 additions & 10 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,37 @@ then
exit 1
fi

msg=`git log -1 --pretty=%B`
# make sure there aren't untracked files that will get uploaded to the website
UNTRACKED_FILES=$(git ls-files --others --exclude-standard)
if [ -n "${UNTRACKED_FILES}" ] ; then
echo "Error: Untracked files. Please commit or stash before updating master."
exit 1
fi

echo "Checking out source"
git checkout source
echo
# make sure the source branch is up-to-date with origin/source
echo "Fetching content from remote"
git fetch --quiet origin

echo "Pulling updates to the source"
git pull --quiet origin source
echo
COUNT_MISSING="$(git rev-list --count source..origin/source)"
if [ "${COUNT_MISSING}" != 0 ] ; then
echo "Error: the 'source' branch is not up-to-date. Please do a 'git pull'"
exit 1
fi

COUNT_EXTRA="$(git rev-list --count origin/source..source)"
if [ "${COUNT_EXTRA}" != 0 ] ; then
echo "Error: the 'source' branch contains changes that have not been merged!"
echo
echo " Please create a PR for these changes. After the PR is merged, "
echo " please pull from the source branch and run the ./deploy.sh script again."
exit 1
fi

# fetch master
echo "Pulling master"
# Check out master in _site
echo "Checking out master in _site"
(
cd _site
git checkout --quiet master
git fetch --quiet origin
git reset --quiet --hard origin/master

# update the documentation?
Expand Down Expand Up @@ -106,6 +121,7 @@ echo
# deploy master
(
cd _site
msg=`git log -1 --pretty=%B`

# check if there are any changes on master
untracked=`git ls-files --other --exclude-standard --directory`
Expand Down