Giter VIP home page Giter VIP logo

react-github-ci-test's Introduction

React GitHub CI

#1 Deploy to GH Pages

npm install gh-pages --save-dev

Add below snippet in package.json

     "homepage": "https://karthicksivakumar191194.github.io/react-github-ci-test",
      "scripts": {
    	......
    	"predeploy": "npm run build",
    	"deploy": "gh-pages -d build"
    },
  • homepage - URL where the react will be running. This is not related to gh-pages, since we adding the react to sub-directory we adding this to tell create-react-app so production build points to right path.
  • We adding two new scripts to react - predeploy & deploy.
    • predeploy - Take build of the project, we will be hosting only the build files.
    • deploy - Deploys to the server, we can view the site on github page or custom domain URL as we set. -d build refers the destination folder we need to deploy to server. When we run this cmd first time it will create a branch 'gh-pages' in github.

Source Branch for the GitHub Pages needs to set in https://github.com/karthicksivakumar191194/react-github-ci-test/settings

Custom Domain for GH-Pages

Manuall Deploy

When you run npm run deploy in terminal, the npm run build cmd will run and the folders inside the 'build' pushed to github repo 'gh-pages' branch and you can view the output in the URL

Auto Deploy

When codes pushed to main branch, will auto deploy to 'gh-pages'.

react-github-ci-test's People

Contributors

karthicksivakumar191194 avatar

Watchers

 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.