From 315bd6abfb3e5440e692ff921da9f475d1755c80 Mon Sep 17 00:00:00 2001 From: GoogolGenius <81032623+GoogolGenius@users.noreply.github.com> Date: Thu, 23 Jan 2025 02:14:02 -0600 Subject: [PATCH] Add Firebase Auto Deploy (#140) --- .github/workflows/firebase-hosting-merge.yml | 20 +++++++++++++++++++ .../firebase-hosting-pull-request.yml | 17 ++++++++++++++++ firebase.json | 6 +++++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..bb4e60c --- /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_MAGNIFYYYYY }}' + channelId: live + projectId: magnifyyyyy diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..72939b8 --- /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_MAGNIFYYYYY }}' + projectId: magnifyyyyy diff --git a/firebase.json b/firebase.json index faae95c..ca363a9 100644 --- a/firebase.json +++ b/firebase.json @@ -2,7 +2,11 @@ "hosting": { "public": "build", "site": "magnify", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], "rewrites": [ { "source": "**",