Skip to content

Instantly share code, notes, and snippets.

@r4hulp
Last active June 29, 2018 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r4hulp/bb8ef63a7680fcb26f329d8afce4c56d to your computer and use it in GitHub Desktop.
Save r4hulp/bb8ef63a7680fcb26f329d8afce4c56d to your computer and use it in GitHub Desktop.
Travis Build Script for Jekyll and Firebase
#use node_js
language: node_js
#define node js version to use
node_js:
- "7"
#choose branch on commit of which this script should excecute
branches:
only:
- master
#set notifications frequency
notifications:
email:
on_success: never
on_failure : change
before_install:
#install rvm 2.2
- rvm install 2.2
#use rvm 2.2
- rvm use 2.2
#set home varaibles
- . $HOME/.nvm/nvm.sh && nvm install 6.1 && nvm use 6.1
#install gems through bundler
- gem install bundler
#if gems are missing this script will get the missing gems.
- bundle check || bundle install
install:
#install firebase tools, required to deploy on firebase hosting
- npm install -g firebase-tools
# Assume bundler is being used, therefore
# the `install` step will run `bundle install` by default.
script:
#continue even after error
- set -e
#build jekyll site
- jekyll build
after_success:
#deploy to firebase using stored token.
- firebase deploy --token "$FIREBASE_API_TOKEN"
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false # route your build to the container-based infrastructure for a faster build
#Visit article at - http://wrapcode.com
#Cheers, Rahul.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment