Giter Site home page Giter Site logo

zachdeibert / create-react-app-travis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryan-gordon/create-react-app-travis

0.0 2.0 0.0 360 KB

A short number of steps to get a react app build, tested and then hosted on Github Pages using Travis.

License: MIT License

HTML 22.59% CSS 6.25% JavaScript 71.16%

create-react-app-travis's Introduction

Create-React-App-Travis

A short number of steps to get a react app build, tested and then hosted on Github Pages using Travis.

Steps:

Create React App

These steps assume you have NodeJS installed. You also need to install create-react-app. If you dont have this enter :

npm install -g create-react-app

Homepage Setup

By default, React expects the page to be served from the root of a domain. However, if the page is being served on GitHub Pages, it won't be there, so you need to tell React to use relative paths.

Edit your package.json as such:

{
  "name": "...",
  "version": "...",
  "more fields": "...",
  
  "homepage": "."
}

Travis setup

Travis needs to be setup to start builds when we push to the master.

In order to run and build our content we dont need to provide travis with much other than a config file. But in order to give travis access to the repo to push builds we will need to generate a personal access token.

Github Pages Setup

To set up github pages auto builds we need to give travis a personal access token. This can be gotten from here.

We we have the personal access token we need to set it up as an enviroment variable in Travis itself like so :
alt text

alt text

References

Inspired by this article

create-react-app-travis's People

Contributors

ryan-gordon avatar zachdeibert 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.