Skip to content

bklimey/react-deploy-gh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This repo is to test deploying default create-react-app on Github using gh-pages.
Hosted Github site can be accessed here: http://bklimey.github.io/react-deploy-gh

Based on:

  1. https://blog.logrocket.com/deploying-react-apps-github-pages/
  2. https://www.youtube.com/watch?v=Q9n2mLqXFpU

Instructions

Note: Assuming Node.js and Git are already installed

Some commentaries are generated by ChatGPT

  1. On local machine, create a new react project using
    npx create-react-app "react-deploy-gh" ("react-deploy-gh" can be other name)

  2. Navigate into folder
    cd react-deploy-gh

  3. Setup Git for project
    git init

    Initializes a new Git repository in the current directory, creating a new .git subdirectory that will contain all the version control information.

  4. Create new empty repo called react-deploy-gh (can be other name) in Github

  5. Commit and push local repo to Github

    1. git commit -m "first commit"

    Commits the changes made to the repository, creating a new snapshot of the code in its current state. The -m option allows you to add a message describing the changes made in this commit.

    1. git branch -M main

    Renames the default branch from master to main. This is done to avoid using terminology with potentially racist connotations.

    1. git remote add origin https://github.com/bklimey/react-deploy-gh.git

    Adds a remote repository named origin with the specified URL. The remote repository is typically hosted on a platform like GitHub or GitLab, and allows you to push your local changes to a central location that can be accessed by other contributors. bklimey should be your Github username and react-deploy-gh should be your repo name.

    1. git push -u origin main

    Pushes the changes to the main branch of the remote repository named origin. The -u option sets the upstream branch, so that future git push commands without specifying a branch will automatically push to the main branch of the origin remote.

  6. Install gh-pages using
    npm install gh-pages --save-dev

  7. Update package.json by adding
    "homepage": "http://bklimey.github.io/react-deploy-gh", image and
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    image

  8. Push change to Github

  9. Deploy app using
    npm run deploy

  10. Website can now be viewed at http://bklimey.github.io/react-deploy-gh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published