Skip to content

Commit

Permalink
Deploy all targets to Firebase Hosting (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt authored Dec 31, 2023
1 parent 6882cc1 commit 462e68d
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,24 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}

- name: Install Firebase CLI
run: npm install [email protected]

- name: Build
run: |
flutter build web \
--web-renderer canvaskit \
--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 }}"

0 comments on commit 462e68d

Please sign in to comment.