GitHub pull 요청을 통해 실시간 및 미리보기 채널에 배포
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
GitHub 작업을 통해 Firebase Hosting에 배포를 통합할 수 있습니다. 이 GitHub 작업으로 수행할 수 있는 기능은 다음과 같습니다.
GitHub 저장소에 있는 모든 PR에 대해 새로운 미리보기 채널(및 연결된 미리보기 URL)을 만듭니다.
사용자 및 각 검토자가 앱 '미리보기' 버전에서 PR 변경사항을 보고 테스트할 수 있도록 미리보기 URL과 함께 PR에 주석을 추가합니다.

연결된 미리보기 채널에 자동으로 배포하여 각 주석의 변경사항으로 미리보기 URL을 업데이트합니다. 새 주석이 추가되어도 URL은 변경되지 않습니다.
(선택사항) PR이 병합될 때 GitHub 저장소의 현재 상태를 실시간 채널에 배포합니다.
알림: 미리보기 URL을 사용할 때 앱은 Firebase 프로젝트의 실제 백엔드 리소스와 상호작용합니다.
Firebase Hosting에 배포하도록 GitHub 작업 설정
GitHub 저장소(공개 또는 비공개)를 만들거나 기존 항목을 사용합니다. 저장소에 대해 관리자 권한이 있어야 합니다.
저장소의 로컬 버전에서 firebase init
명령어를 사용하여 Firebase Hosting을 설정합니다.
CLI 프롬프트를 따르면 명령어가 GitHub 작업 설정을 자동으로 수행합니다.
Firebase 프로젝트에 Firebase Hosting에 배포할 수 있는 권한이 있는 서비스 계정을 만듭니다.
서비스 계정의 JSON 키를 암호화하고 지정된 GitHub 저장소에 GitHub 보안 비밀로 업로드합니다.
새로 생성된 보안 비밀을 참조하는 GitHub 워크플로 yaml
구성 파일을 작성합니다. 이러한 파일은 Firebase Hosting에 배포하도록 GitHub 작업을 구성합니다.
GitHub에서 새 분기를 만들고 CLI로 만든 워크플로 yaml
파일을 커밋합니다.
브랜치를 GitHub 저장소에 게시합니다.
브랜치를 병합합니다.
작업이 끝났습니다. 이후 이 GitHub 저장소에 PR이 있으면 자동으로 고유한 '미리보기 URL'을 가져옵니다.
GitHub 작업 자세히 알아보기
Firebase는 'Firebase Hosting에 배포' GitHub 작업을 오픈소스 프로젝트로 유지관리합니다.
소스 코드 보기
'Firebase Hosting에 배포' GitHub 작업은 미리보기 채널의 만료 날짜 맞춤설정 또는 PR이 병합될 때 배포할 비 실시간 채널 설정과 같은 추가 구성을 허용합니다.
사용 가능한 구성 옵션에 대해 자세히 알아보기
일반적인 GitHub 작업에 대해 자세히 알아봅니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-28(UTC)
[null,null,["최종 업데이트: 2025-08-28(UTC)"],[],[],null,["\u003cbr /\u003e\n\nYou can integrate deploys to Firebase Hosting via a GitHub Action. Here's\nwhat this GitHub Action can do for you:\n\n- Creates a new preview channel (and its associated preview URL) for every PR on\n your GitHub repository.\n\n- Adds a comment to the PR with the preview URL\n so that you and each reviewer can view and test the PR's changes in a\n \"preview\" version of your app.\n\n- Updates the preview URL with changes from each commit by automatically\n deploying to the associated preview channel. The URL doesn't change with each\n new commit.\n\n- *(Optional)* Deploys the current state of your GitHub repo to your live\n channel when the PR is merged.\n\nReminder: When using preview URLs, your app interacts with the *real* backend\nresources of your Firebase project.\n\nSet up the GitHub Action to deploy to Firebase Hosting\n\n1. Create a GitHub repository (public or private) or use an existing one. You\n must have admin permissions for the repository.\n\n2. In a local version of your repo, set up Firebase Hosting using the\n [`firebase init` command](/docs/hosting/quickstart#initialize).\n\n - If you've NOT set up Hosting, run this version of the command\n from the root of your local directory:\n\n ```\n firebase init hosting\n ```\n - If you've ALREADY set up Hosting, then you just need to set up the\n GitHub Action part of Hosting. Run this version of the command from\n the root of your local directory:\n\n ```\n firebase init hosting:github\n ```\n3. Follow the CLI prompts, and the command will automatically take care of\n setting up the GitHub Action:\n\n - Creates a service account in your Firebase project with permission to\n deploy to Firebase Hosting.\n\n - Encrypts that service account's JSON key and uploads it to the specified\n GitHub repository as a\n [GitHub secret](//docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets).\n\n - Writes GitHub workflow `yaml` configuration files that reference the\n newly created secret. These files configure the GitHub Action to deploy to\n Firebase Hosting.\n\n4. In GitHub, create a new branch and commit the workflow `yaml` files created\n by the CLI.\n\n5. Publish the branch to your GitHub repository.\n\n6. Merge the branch.\n\nThat's it! Any subsequent PR in this GitHub repo will automatically get its own\n\"preview URL\"!\n\nLearn more about the GitHub Action\n\n- Firebase maintains the \"Deploy to Firebase Hosting\" GitHub Action as an\n open-source project.\n [View the source code.](//github.com/marketplace/actions/deploy-to-firebase-hosting)\n\n- The \"Deploy to Firebase Hosting\" GitHub Action allows for further\n configuration, like customizing the expiry date for a preview channel or\n setting a non-live channel to deploy to when a PR is merged.\n [Learn about the available configuration options.](//github.com/marketplace/actions/deploy-to-firebase-hosting#options)\n\n- Learn more about\n [GitHub Actions](//docs.github.com/en/free-pro-team@latest/actions),\n in general."]]