-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c889f1e
Showing
9 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_site | ||
/test-deploy.sh | ||
.idea/ | ||
Gemfile.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "website-assets"] | ||
path = website-assets | ||
url = https://github.com/montrealrobotics/website-assets.git | ||
branch = master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source 'https://rubygems.org' | ||
group :jekyll_plugins do | ||
gem 'github-pages' | ||
gem 'jekyll' | ||
gem 'jekyll-paginate' | ||
gem 'jekyll-scholar' | ||
gem 'jemoji' | ||
gem 'unicode_utils' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# targets that aren't filenames | ||
.PHONY: all clean deploy build serve | ||
|
||
all: build | ||
|
||
|
||
build: | ||
bundle exec jekyll build | ||
|
||
install: | ||
bundle install | ||
|
||
# you can configure these at the shell, e.g.: | ||
# SERVE_PORT=5001 make serve | ||
SERVE_HOST ?= 127.0.0.1 | ||
SERVE_PORT ?= 5000 | ||
|
||
serve: | ||
bundle exec jekyll serve --port $(SERVE_PORT) --host $(SERVE_HOST) | ||
|
||
deploy: | ||
git commit -am"updating"; git push | ||
|
||
clean: | ||
$(RM) -r _site | ||
|
||
deploy: clean build | ||
./bin/deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
url: https://montrealrobotics.github.io | ||
|
||
includes_dir: website-assets/_includes | ||
layouts_dir: website-assets/_layouts | ||
sass: | ||
sass_dir: website-assets/_sass | ||
asset_dir: /website-assets/assets | ||
|
||
base: '' | ||
|
||
# Navigation bar links. | ||
navigation: | ||
- title: Home | ||
link: / | ||
- title: People | ||
link: /people.html | ||
- title: Research | ||
link: /research.html | ||
- title: Publications | ||
link: /publications/ | ||
- title: Contact | ||
link: /contact.html | ||
- title: Blog | ||
link: /blog.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run this script to deploy the app to Github Pages | ||
|
||
# Parse cmd arguments | ||
|
||
SRC_BRANCH="source" | ||
DEPLOY_BRANCH="master" | ||
|
||
USAGE_MSG="usage: deploy [-h|--help] [-u|--user] [-s|--src SRC_BRANCH] [-d|--deploy DEPLOY_BRANCH]" | ||
|
||
while [[ $# > 0 ]]; do | ||
key="$1" | ||
|
||
case $key in | ||
-h|--help) | ||
echo $USAGE_MSG | ||
exit 0 | ||
;; | ||
-u|--user) | ||
SRC_BRANCH="source" | ||
DEPLOY_BRANCH="master" | ||
shift | ||
;; | ||
-s|--src) | ||
SRC_BRANCH="$2" | ||
shift | ||
;; | ||
-d|--deploy) | ||
DEPLOY_BRANCH="$2" | ||
shift | ||
;; | ||
*) | ||
echo "Option $1 is unknown." | ||
echo $USAGE_MSG | ||
exit 0 | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
# Exit if any subcommand fails | ||
set -e | ||
|
||
echo "Deploying..." | ||
echo "Source branch: $SRC_BRANCH" | ||
echo "Deploy branch: $DEPLOY_BRANCH" | ||
|
||
read -r -p "Do you want to proceed? [y/N] " response | ||
if [[ ! $response =~ ^([yY][eE][sS]|[yY])+$ ]] | ||
then | ||
echo "Aborting." | ||
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 | ||
fi | ||
|
||
# Check if there are any uncommitted changes | ||
if ! git diff-index --quiet HEAD --; then | ||
echo "Changes to the following files are uncommitted:" | ||
git diff-index --name-only HEAD -- | ||
echo "Please commit the changes before proceeding." | ||
echo "Aborting." | ||
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 | ||
fi | ||
|
||
# Switch to source branch (creates it if necessary from the current branch) | ||
if [ `git branch | grep $SRC_BRANCH | tr ' ' '\n' | tail -1` ] | ||
then | ||
git checkout $SRC_BRANCH | ||
else | ||
git checkout -b $SRC_BRANCH | ||
fi | ||
|
||
# Checkout DEPLOY_BRANCH branch | ||
if [ `git branch | grep $DEPLOY_BRANCH` ] | ||
then | ||
git branch -D $DEPLOY_BRANCH | ||
fi | ||
git checkout -b $DEPLOY_BRANCH | ||
|
||
|
||
# Build site | ||
bundle exec jekyll build | ||
|
||
git submodule deinit --all | ||
|
||
# Delete and move files | ||
find . -maxdepth 1 ! -name '_site' ! -name '.git' ! -name '.gitignore' -exec rm -rf {} \; | ||
mv _site/* . | ||
rm -R _site/ | ||
rm -rf .git/modules | ||
|
||
# Push to DEPLOY_BRANCH | ||
|
||
git add -fA | ||
git commit --allow-empty -m "$(git log -1 --pretty=%B) [ci skip]" | ||
git push -f -q origin $DEPLOY_BRANCH | ||
|
||
|
||
git rm --cached website-assets | ||
git commit -m"remove" | ||
git push -f -q origin $DEPLOY_BRANCH | ||
git add website-assets | ||
git commit -m"add" | ||
git push -f -q origin $DEPLOY_BRANCH | ||
|
||
# Move back to SRC_BRANCH | ||
git checkout $SRC_BRANCH | ||
rm -rf website-assets | ||
git submodule init | ||
git submodule update | ||
cd website-assets | ||
git checkout master | ||
cd .. | ||
echo "Deployed successfully!" | ||
|
||
exit 0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: default | ||
title: Project template | ||
permalink: index.html | ||
--- | ||
|
||
Edit this |
Submodule website-assets
added at
4b90f6