From 54b59ba75662bdbd5a4d19ab888598618fd5f141 Mon Sep 17 00:00:00 2001 From: sryung Date: Wed, 13 Dec 2023 18:10:42 +0900 Subject: [PATCH] =?UTF-8?q?[=E2=9A=99=20:=20chore]=20Firebase=20Hosting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .firebase/hosting.ZGlzdA.cache | 4 ++++ .firebaserc | 5 +++++ .github/workflows/firebase-hosting-merge.yml | 20 +++++++++++++++++++ .../firebase-hosting-pull-request.yml | 17 ++++++++++++++++ firebase.json | 16 +++++++++++++++ package.json | 4 +++- 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .firebase/hosting.ZGlzdA.cache create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 firebase.json diff --git a/.firebase/hosting.ZGlzdA.cache b/.firebase/hosting.ZGlzdA.cache new file mode 100644 index 0000000..555f591 --- /dev/null +++ b/.firebase/hosting.ZGlzdA.cache @@ -0,0 +1,4 @@ +logo.ico,1701433871282,37a4072cc6645faeccf408219d276c9de0736e566d6a65b06e7c0629abe53e76 +index.html,1702458494045,e9cc563b3b01874b22db161a30b5edbe7c48170d3d9b2b30cc5c6a2b0f871a54 +assets/logo-big-yB_EDFVs.png,1702458494045,b0c918f3c4bfc670ce24fde66f371827ca452fd24bc1e4adf2da9beda392c362 +assets/index-BSVUOpMg.js,1702458494045,ed3f242cbc815ed6e24addd32bd3575b9d9f3d91ccf7feeea58b1241239a8bf3 diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..bd53e17 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "xwitter-c64ef" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..3d57bcc --- /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@v3 + - run: npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_XWITTER_C64EF }}' + channelId: live + projectId: xwitter-c64ef diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..44e7827 --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,17 @@ +# 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 +jobs: + build_and_preview: + if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_XWITTER_C64EF }}' + projectId: xwitter-c64ef diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..2c33c29 --- /dev/null +++ b/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} diff --git a/package.json b/package.json index 2702250..db137ce 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "dev": "vite", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "preview": "vite preview", + "predeploy": "npm run build", + "deploy": "firebase deploy" }, "dependencies": { "firebase": "^10.1.0",