When deploying flutter to firebase from local machine I do following and it works:
flutter build web
firebase deploy
When trying to deploy from GHA , my yaml file looks like this
test_deploy_to_dev:
name: deploy
needs:
- label_check
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: auth
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/1111111/locations/global/workloadIdentityPools/abc/providers/xyz'
service_account: 'firebase-deploy-flutter@project123.iam.gserviceaccount.com'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Run flutter pub get
run: flutter pub get
- name: Enable flutter web
run: flutter config --enable-web
- name: Build Web App
run: flutter build web
- name: deploy flutter to firestore
run: |
npm install -g firebase-tools
firebase init
firebase deploy
Google auth part works.
In GHA, I get error - Failed to authenticate, have you run firebase login?