From ec9544990afed574f643a759901b654cb7854cdc Mon Sep 17 00:00:00 2001 From: Austen Sorochak Date: Wed, 17 Apr 2024 14:45:41 -0700 Subject: [PATCH 1/4] update workflow file --- .github/workflows/firebase-deploy.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yaml b/.github/workflows/firebase-deploy.yaml index c9ccd265..f1c83eb4 100644 --- a/.github/workflows/firebase-deploy.yaml +++ b/.github/workflows/firebase-deploy.yaml @@ -32,10 +32,14 @@ jobs: echo "REACT_APP_GOOGLE_CLOUD_API_KEY=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY }}" >> .env echo "REACT_APP_GOOGLE_CLOUD_API_KEY_DEV=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY_DEV }}" >> .env working-directory: firebase-functions/functions + + - name: Set Firebase Project + run: firebase use default # Use the alias for your project + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - name: Deploy to Firebase uses: w9jds/firebase-action@v13.2.1 with: - projectId: cioos-metadata-form args: deploy --only functions env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} From e137fe9a477a05f63768adbe0dd5a51343f2c0ef Mon Sep 17 00:00:00 2001 From: Austen Sorochak Date: Wed, 17 Apr 2024 14:46:28 -0700 Subject: [PATCH 2/4] update workflow file --- .github/workflows/firebase-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yaml b/.github/workflows/firebase-deploy.yaml index f1c83eb4..d6302ee2 100644 --- a/.github/workflows/firebase-deploy.yaml +++ b/.github/workflows/firebase-deploy.yaml @@ -34,7 +34,7 @@ jobs: working-directory: firebase-functions/functions - name: Set Firebase Project - run: firebase use default # Use the alias for your project + run: firebase use default env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - name: Deploy to Firebase From 63c1a7b50089133d202a8ff2473127a62d500fca Mon Sep 17 00:00:00 2001 From: Austen Sorochak Date: Wed, 17 Apr 2024 14:54:55 -0700 Subject: [PATCH 3/4] install firebase cli in action --- .github/workflows/firebase-deploy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/firebase-deploy.yaml b/.github/workflows/firebase-deploy.yaml index d6302ee2..9e9296a6 100644 --- a/.github/workflows/firebase-deploy.yaml +++ b/.github/workflows/firebase-deploy.yaml @@ -17,6 +17,8 @@ jobs: - name: Install Dependencies run: npm ci working-directory: firebase-functions + - name: Install Firebase CLI + run: npm install -g firebase-tools - name: Install Dependencies run: npm ci working-directory: firebase-functions/functions From 440009627c03224951fbc0cd772375295e808ff3 Mon Sep 17 00:00:00 2001 From: Austen Sorochak Date: Wed, 17 Apr 2024 15:05:57 -0700 Subject: [PATCH 4/4] consolidate firebase commands --- .github/workflows/firebase-deploy.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/firebase-deploy.yaml b/.github/workflows/firebase-deploy.yaml index 9e9296a6..914f59ee 100644 --- a/.github/workflows/firebase-deploy.yaml +++ b/.github/workflows/firebase-deploy.yaml @@ -22,8 +22,9 @@ jobs: - name: Install Dependencies run: npm ci working-directory: firebase-functions/functions - - name: Create .env file + - name: Authenticate Firebase and Deploy run: | + echo "Creating .env file..." echo "GMAIL_USER=${{ secrets.GMAIL_USER }}" >> .env echo "GMAIL_PASS=${{ secrets.GMAIL_PASS }}" >> .env echo "DATACITE_AUTH_HASH=${{ secrets.DATACITE_AUTH_HASH }}" >> .env @@ -33,16 +34,11 @@ jobs: echo "GITHUB_AUTH=${{ secrets.ISSUE_CREATOR_PAT }}" >> .env echo "REACT_APP_GOOGLE_CLOUD_API_KEY=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY }}" >> .env echo "REACT_APP_GOOGLE_CLOUD_API_KEY_DEV=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY_DEV }}" >> .env + echo "Setting Firebase Project..." + firebase use default + echo "Deploying to Firebase..." + firebase deploy --only functions --token ${{ secrets.FIREBASE_TOKEN }} working-directory: firebase-functions/functions - - - name: Set Firebase Project - run: firebase use default - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - - name: Deploy to Firebase - uses: w9jds/firebase-action@v13.2.1 - with: - args: deploy --only functions env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} GMAIL_USER: ${{ secrets.GMAIL_USER }}