From b938769bba346c6118ac1764dbc771637c5497d8 Mon Sep 17 00:00:00 2001
From: Ka Chun <34387770+kachun333@users.noreply.github.com>
Date: Fri, 10 Feb 2023 20:29:34 +0800
Subject: [PATCH 1/4] [Action] Deploy to Firebase Hosting Staging on Labeled

---
 .github/workflows/prod-deploy-on-release.yml  |  5 +----
 .../workflows/staging-deploy-on-labeled.yml   | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)
 create mode 100644 .github/workflows/staging-deploy-on-labeled.yml

diff --git a/.github/workflows/prod-deploy-on-release.yml b/.github/workflows/prod-deploy-on-release.yml
index 3ad8e1b..82e805e 100644
--- a/.github/workflows/prod-deploy-on-release.yml
+++ b/.github/workflows/prod-deploy-on-release.yml
@@ -1,7 +1,4 @@
-# This file was auto-generated by the Firebase CLI
-# https://github.com/firebase/firebase-tools
-
-name: Deploy to Firebase Hosting on Release
+name: Deploy to Firebase Hosting Live on Release
 on:
   push:
     tags:
diff --git a/.github/workflows/staging-deploy-on-labeled.yml b/.github/workflows/staging-deploy-on-labeled.yml
new file mode 100644
index 0000000..73af7ed
--- /dev/null
+++ b/.github/workflows/staging-deploy-on-labeled.yml
@@ -0,0 +1,19 @@
+name: Deploy to Firebase Hosting Staging on Labeled
+on:
+  pull_request:
+    types:
+      - labeled
+jobs:
+  deploy_staging_preview:
+    if: |
+      '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
+      && github.event.label.name == 'need-preview'
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - run: npm ci && npm run build
+      - uses: FirebaseExtended/action-hosting-deploy@v0
+        with:
+          repoToken: "${{ secrets.GITHUB_TOKEN }}"
+          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_OURPROMISE }}"
+          projectId: ourpromise

From ca46ec187eff8606e02cf3b01f4eabbfb8e3946c Mon Sep 17 00:00:00 2001
From: Ka Chun <34387770+kachun333@users.noreply.github.com>
Date: Fri, 10 Feb 2023 20:36:37 +0800
Subject: [PATCH 2/4] [Action] fix Staging deploy labeled bug

---
 .github/workflows/staging-deploy-on-labeled.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/staging-deploy-on-labeled.yml b/.github/workflows/staging-deploy-on-labeled.yml
index 73af7ed..825c71f 100644
--- a/.github/workflows/staging-deploy-on-labeled.yml
+++ b/.github/workflows/staging-deploy-on-labeled.yml
@@ -7,7 +7,7 @@ jobs:
   deploy_staging_preview:
     if: |
       '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
-      && github.event.label.name == 'need-preview'
+      && '${{ github.event.label.name == 'need-preview' }}'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2

From 5ce00fe6a7d0c740186ec43064869a1e25009dd5 Mon Sep 17 00:00:00 2001
From: Ka Chun <34387770+kachun333@users.noreply.github.com>
Date: Fri, 10 Feb 2023 20:45:01 +0800
Subject: [PATCH 3/4] [Action] fix Staging deploy labeled bug

---
 .github/workflows/staging-deploy-on-labeled.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/staging-deploy-on-labeled.yml b/.github/workflows/staging-deploy-on-labeled.yml
index 825c71f..c1002be 100644
--- a/.github/workflows/staging-deploy-on-labeled.yml
+++ b/.github/workflows/staging-deploy-on-labeled.yml
@@ -6,8 +6,8 @@ on:
 jobs:
   deploy_staging_preview:
     if: |
-      '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
-      && '${{ github.event.label.name == 'need-preview' }}'
+      ${{ github.event.pull_request.head.repo.full_name == github.repository }} &&
+      ${{ github.event.label.name == 'need-preview' }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2

From f1b421b4eba13978110d72b3ac4740d5fd6681e1 Mon Sep 17 00:00:00 2001
From: Ka Chun <34387770+kachun333@users.noreply.github.com>
Date: Fri, 10 Feb 2023 20:49:52 +0800
Subject: [PATCH 4/4] [Action] fix Staging deploy labeled bug

---
 .github/workflows/staging-deploy-on-labeled.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/staging-deploy-on-labeled.yml b/.github/workflows/staging-deploy-on-labeled.yml
index c1002be..8de7ef7 100644
--- a/.github/workflows/staging-deploy-on-labeled.yml
+++ b/.github/workflows/staging-deploy-on-labeled.yml
@@ -6,8 +6,8 @@ on:
 jobs:
   deploy_staging_preview:
     if: |
-      ${{ github.event.pull_request.head.repo.full_name == github.repository }} &&
-      ${{ github.event.label.name == 'need-preview' }}
+      github.event.pull_request.head.repo.full_name == github.repository &&
+      github.event.label.name == 'need-preview'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2