Update firebase_hosting.yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Firebase Hosting | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Repository checkout | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# 2. Set up Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" # Node.js 버전은 프로젝트에 맞게 변경 | |
# 3. Install dependencies | |
- name: Install Dependencies | |
run: npm install | |
# 4. Build project | |
- name: Build Project | |
run: npm run build # build 스크립트는 프로젝트에 맞게 변경 | |
# 5. Set up Firebase Authentication | |
- name: Set up Firebase Authentication | |
run: echo "${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}" > serviceAccountKey.json | |
# 6. Deploy to Firebase | |
- name: Deploy to Firebase | |
run: firebase deploy --only hosting --project your-project-id | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: serviceAccountKey.json |