Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
Firebaseにデプロイ (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sey323 authored Jun 8, 2024
1 parent ad454bb commit 632e2e1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_EN_XROSS_XR_HACKATHON }}'
channelId: live
projectId: en-xross-xr-hackathon
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_EN_XROSS_XR_HACKATHON }}'
projectId: en-xross-xr-hackathon
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ logs
!.env.example

# GCP Key
key.json
key.json

# Firebase
.firebase
13 changes: 13 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": {
"source": ".output/server",
"runtime": "nodejs20"
},
"hosting": {
"public": ".output/public",
"cleanUrls": true,
"rewrites": [{ "source": "**", "function": "server" }],
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"frameworksBackend": {
"region": "asia-east1"
}
}
}
11 changes: 11 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
// Firebase Functionのデプロイのため必要
nitro: {
firebase: {
nodeVersion: "20",
gen: 2,
httpsOptions: {
region: "us-central1",
maxInstances: 3,
},
},
},
devtools: { enabled: true },
modules: ["@nuxtjs/tailwindcss"],
app: {
Expand Down

0 comments on commit 632e2e1

Please sign in to comment.