Coder Social home page Coder Social logo

travis-gh-pages-setup's Introduction

Travis gh-pages Setup

Sets up Travis CI to automatically publish to gh-pages. Currently the process is intended for NodeJS projects only, but could be changed for other environments.

Automated Steps (steps can be opted out of):

  • Creating an empty gh-pages branch
  • Creating an SSH key for deployment
    • Runs ssh-keygen to create the key
    • Encrypts the file and adds to Travis CI configuration
    • Commits the encrypted key to the Git repository (for Travis CI to decrypt)
    • Requests the user to upload the public key as a GitHub deployment key
    • Deletes the public and private keys for security
  • Installs gh-pages-travis (an NPM package) to handle committing and pushing assets from Travis back to GitHub
  • Configures Travis CI
    • Creates a Travis CI configuration file if needed (.travis.yml) setup for NodeJS
    • Adds gh-pages-travis to run, setting Git details, the directory to upload, and linking the SSH key
    • Prevents Travis CI from running on the gh-pages branch

Usage

The script assumes that you are running on a Unix system with:

  • git
  • travis.rb, Travis CI's command line tool, authenticated with your account (travis login)
  • The GitHub repository added as a remote repository (git remote add ...)

Save and commit all work if you will be creating a new, empty gh-pages branch. All files in the repository will be removed, including untracked files.

To download and run the script immediately, use curl:

curl -o- https://raw.githubusercontent.com/CodeLenny/travis-gh-pages-setup/master/travis-gh-pages-setup.sh | bash

If you want to save the script to run multiple times, you can download and save the script on your computer.

curl https://raw.githubusercontent.com/CodeLenny/travis-gh-pages-setup/master/travis-gh-pages-setup.sh -o ~/bin/travis-gh-pages-setup.sh

By default, the script will open a dialog to walk you through the setup. Each step of the script can be disabled, and the different values used throughout the script can be altered on the configuration page. A description of each variable is available on the "Change Value" page.

Variables can be preset by setting an environment variable when running the script. All variables match the name given in the configuration page, in all capitals and with spaces replaced with underscores.

For instance, the "Safe Clean" and "Deploy Branch" configuration options can be preset via:

SAFE_CLEAN=false DEPLOY_BRANCH="production" bash travis-gh-pages-setup.sh

travis-gh-pages-setup's People

Contributors

codelenny avatar

Watchers

James Cloos 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.