diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..d4556db --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "nextani-415707" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..a0842be --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -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_NEXTANI_415707 }}' + channelId: live + projectId: nextani-415707 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..819e01c --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -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 run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_NEXTANI_415707 }}" + projectId: nextani-415707 diff --git a/.gitignore b/.gitignore index e77be0e..defe0a5 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +#firebase +/.firebase/ \ No newline at end of file diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..461fe72 --- /dev/null +++ b/firebase.json @@ -0,0 +1,13 @@ +{ + "hosting": { + "source": ".", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "frameworksBackend": { + "region": "asia-east1" + } + } +} diff --git a/pages/login.jsx b/pages/login.jsx index 7a9d1e0..9fd7864 100644 --- a/pages/login.jsx +++ b/pages/login.jsx @@ -1,7 +1,7 @@ import { Button, Input } from "@nextui-org/react"; import Link from "next/link"; import { useState, useMemo } from "react"; -import Oauth2 from "@/components/auth/Oauth2"; +import Oauth2 from "@/components/auth/oauth2"; import { useRouter } from "next/router"; import { EyeFilledIcon, EyeSlashFilledIcon } from "@/icons"; import { login } from "@/utils/firebaseAuth"; diff --git a/utils/firebaseAuth.js b/utils/firebaseAuth.js index 35aa917..2fbc742 100644 --- a/utils/firebaseAuth.js +++ b/utils/firebaseAuth.js @@ -8,7 +8,7 @@ import { getAnalytics } from "firebase/analytics"; // For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyBUh34fVGomF1fmLtmwZyW_FIi9jRVZYFM", - authDomain: "nextani-415707.firebaseapp.com", + authDomain: "nextani.net", projectId: "nextani-415707", storageBucket: "nextani-415707.appspot.com", messagingSenderId: "774743828666",