From 462e68df7581dd5e4e4ec2d08c5cd7b5b37970df Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Sun, 31 Dec 2023 14:35:01 +0100 Subject: [PATCH] Deploy all targets to Firebase Hosting (#129) --- .github/workflows/main.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2148a174..ab92afb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,6 +55,9 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} channel: ${{ env.FLUTTER_CHANNEL }} + - name: Install Firebase CLI + run: npm install firebase-tools@13.0.2 + - name: Build run: | flutter build web \ @@ -62,21 +65,14 @@ jobs: --dart-define=RELEASE_DATE="$(date +"%B %e %Y")" \ --dart-define=FLAVOR="${{ matrix.environment.flavor }}" - - id: "auth" - uses: "google-github-actions/auth@67e9c72af6e0492df856527b474995862b7b6591" + - id: auth + uses: google-github-actions/auth@67e9c72af6e0492df856527b474995862b7b6591 with: workload_identity_provider: "projects/${{ matrix.environment.projectNumber }}/locations/global/workloadIdentityPools/github/providers/github-provider" - service_account: "github-action-644087301@${{ matrix.environment.projectId }}.iam.gserviceaccount.com" + service_account: "firebase-hosting-deployer@${{ matrix.environment.projectId }}.iam.gserviceaccount.com" - # From https://github.com/FirebaseExtended/action-hosting-deploy/issues/174#issuecomment-1312272238 - - name: Set SERVICE_ACCOUNT_KEY to environment variables + - name: Deploy run: | - echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.auth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV - - - uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ env.SERVICE_ACCOUNT_KEY }}" - channelId: live - target: ankigpt-app - projectId: "${{ matrix.environment.projectId }}" + firebase deploy \ + -P ${{ matrix.environment.projectId }} \ + -m "Deploy from ${{ github.repository }} ${{ github.sha }}"