Skip to content

AlTimofeyev/portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes To Self

Deploying create-react-app application using GitHub Pages Resource

If Deleting Everything To Start From Scratch

  • Delete all files in main branch, preferably using the GitHub website.
  • Save/Copy/Remove all local files and directories pertaining to this repository.
  • Clone repo to local machine.
  • cd into the cloned repo directory on local machine.
  • Run npx create-react-app . to create react app in current directory.
    ~/GitHub > git clone https://github.com/AlTimofeyev/portfolio.git portfolio
    ~/GitHub > cd portfolio
    ~/GitHub/portfolio > npx create-react-app .
    ~/GitHub/portfolio > code .
  • Install gh-pages and all necessary packages.
  • Add homepage name, predeploy script and deploy script to package.json file.
    {
        "homepage": "https://AlTimofeyev.github.io/portfolio",
        "name":     "portfolio",
        "version":  "0.1.0",
        [... all other json data ...]
        "scripts": {
            "predeploy": "npm run build",
            "deploy": "gh-pages -d build",
            "start": "react-scripts start",
            "build": "react-scripts build",
            "test": "react-scripts test",
            "eject": "react-scripts eject"
        },
        [... all other json data ...]
    }
  • Continue working on react app locally and git push updates to main branch when finished.
  • Use the command npm run deploy in local portfolio directory (main branch) to publish updates to GitHub Pages.
    ~/GitHub/portfolio > npm run deploy

If Updating Without Starting From Scratch

  • Continue working on react app locally and git push updates to main branch when finished.
  • Use the command npm run deploy in local portfolio directory (main branch) to publish updates to GitHub Pages.

GitHub Pages gh-pages Repository



Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open https://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames