Git Product home page Git Product logo

travis-jekyll-git's Introduction

Deploy Jekyll pages using Git and Travis CI

GitHub Pages are an amazing way to host Jekyll pages, but in some cases, you might be interested in running your Jekyll page on a different host (like Azure Web Apps, Heroku, AWS). Since the magic of Jekyll is that it generates static websites, I did not want to run a full Ruby server. Instead, I'm using Travis CI to setup a devops build pipeline, taking new commits, testing the page, and deploying it. Here's the workflow:

  • Create a new commit, triggering Travis CI
  • Install Ruby, Jekyll, HTMLProofer, and all dependencies
  • Compile the page
  • Test that all images and links work (using HTMLProofer)
  • If the test passed, enter the generated _site directory and create a new empty Git repository
  • Add and commit all static files
  • Force-push the result to a desired remote Git repo, suppressing any potentially compromising log messages

The files of interest here are .travis.yml, _config_ci.yml, scripts/build.sh and scripts/deploy.sh. The Travis configuration file instructs Travis, to build, test, and deploy using _config_ci.yml as Jekyll configuration and scripts/deploy.sh as the custom deployment provider.

To use this for your own project, update .travis.yml with your own white- and blacklisted branches. Then, check build.sh and ensure that the settings for jekyll build and HTMLProofer are fit for your site (in most cases, they should be). Finally, go to your Travis Profile to edit the settings for your source repository. In there, add three environment variables:

  • git_user Git username
  • git_password Git password
  • git_target Git target repository url (without https://)

Include the four files in this repo in your source repo - and you're good to go!

License

MIT, please see LICENSE for details.

travis-jekyll-git's People

Contributors

felixrieseberg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.