Open5
Firebase Hostingを使ってWebアプリをデプロイ

Next.jsで作ったアプリをデプロイします.
Hostingをするためにfirebase init hosting
というcommandを叩く必要があるのだが,
FirebaseCLIがないと叩けないので,ない場合はまず,npm install -g firebase-tools
firebase login
でログインしておく
デプロイしたいアプリ内でfirebase init hosting
を叩くといろいろ聞かれる.
すでにあるプロジェクトなので
`Use an existing project`
次にデプロイするFirebaseにあるアプリを選択
What do you want to use as your public directory? public
ReactはSPAなので,
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? Yes
せっかくなんでGitHubと連携してみた
連携する`ユーザ名/リポジトリ名`を入力する
? Set up the workflow to run a build script before every deploy? No
? Set up automatic deployment to your site's live channel when a PR is merged? Y
es
? What is the name of the GitHub branch associated with your site's live channel
? main
なんかいろいろファイルが作られた

既存のFirebaseのconfigファイルは変更されてないので,アプリの機能に問題はなさそう.

いざデプロイ
firebase deploy --only hosting
成功したぽいのででデプロイ先のURLを見てみると
は?

時間がかかるのかなと思いきやビルドを忘れていました.
yarn build
します.
上手く言ったので再びfirebase deploy --only hosting
わくわく

できない...
意味わからん