1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

github pagesにReactアプリを公開する

Posted at

Reactアプリの作成

cd desktop/
npx create-react-app wikiquiz-test --template typescript
cd wikiquiz-test

gh-pagesをインストール

npm install gh-pages --save-dev

package.jsonにhomepageを追加する

package.json
{
  ...,
  "scripts": {
    ...,
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },
  ...,
  "homepage": "https://super-pylori.github.io/wikiquiz-test/"
}

githubで新規リポジトリ作成

新規リポジトリを作成する
作成したらリモートリポジトリを追加する

git remote add origin git@github.com:super-pylori/wikiquiz-test.git
git push origin master

デプロイ

npm run build
npm run deploy

これでhttps://super-pylori.github.io/wikiquiz-test/が公開される
githubのSettings→PagesでURLとか確認できる

参考

ReactアプリをGitHub Pages(Project Pages)で公開する

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?