본문 바로가기
Frontend/React

[Firebase] 파이어베이스를 이용해서 앱 배포하기

by 디스코비스킷 2023. 12. 8.
반응형

11. 파이어베이스를 이용해서 앱 배포하기

1. 깃헙 commit&push

2. firebase를 사용하기위한 모듈 전역 설치

npm install -g firebase-tools
firebase login

3. build하기

npm run build

4. firebase 시작하기

firebase init

화살표와 스페이스바 이용해서 다음 선택지 체크

  • Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys

  • 이미 만들어진 프로젝트 호스팅할거임
    Please select an option: Use an existing project

  • firebase 프로젝트 선택하기
    Select a default Firebase project for this directory: (Use arrow keys)
    > react-pokemon-app-c8a1d (react-pokemon-app)

  • 무슨폴더를 public폴더로 이용할건지?
    What do you want to use as your public directory? dist
    CRA로 만들었다면 build라고 생성이 되어있을거임

  • SPA(single-page app)인지?
    Configure as a single-page app (rewrite all urls to /index.html)? (y/N) y

  • 깃헙으로 자동빌드&배포 셋업?
    Set up automatic builds and deploys with GitHub? Y

  • index.html 오버라이트할건지?
    File dist/index.html already exists. Overwrite? N

  • authorize firebase하기

  • 어떤 깃헙 레파지토리로 워크플로우를 셋업하기 원하느냐? user/repository
    For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) jngmnj/react-pokemon-app

  • 배포전에 항상 npm run build 할건지? y
    Set up the workflow to run a build script before every deploy? Yes

  • 배포전에 무슨 스크립트 써야하는지? npm intall && npm run build
    What script should be run before every deploy? (npm ci && npm run build) npm intall && npm run build

  • PR 머지될때 라이브채널에 자동 배포 셋업할거냐?
    Set up automatic deployment to your site's live channel when a PR is merged Y

  • 너 사이트에 라이브채널에 연결되어야하는 브랜치?
    What is the name of the GitHub branch associated with your site's live channel? master

완료되면 이런 메시지가 뜬다.

git add .
git commit -m "deploy"
git push origin master

5. 깃헙 페이지에서 배포 확인


6. firebase 콘솔에서 확인


포켓몬도감앱 배포 바로가기

반응형

최근댓글

최근글

© Copyright 2024 ttutta