angularfire
angularfire copied to clipboard
Deploy not working with service account in github actions
Version info
Angular: 14.1.0
AngularFire: 7.4.1
Firebase CLI: Latest being downloaded every time by the actions runner
How to reproduce these conditions
Steps to set up and reproduce
Running the build in a github actions runner with service account exits because the CLI is not signed in
Expected behavior
The application being built and deployed
Actual behavior
The deploy command exits before building the app
This issue does not seem to follow the issue template. Make sure you provide all the required information.
Working in @angular/[email protected] & [email protected]:
- Add this auth step before your deploy command using the secret generated by
% firebase init hosting:github
; use the output for the FIREBASE_TOKEN env variable:
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PROJECT_XYZ }}
token_format: access_token
- run: ng deploy
env:
FIREBASE_TOKEN: ${{ steps.auth.outputs.access_token }}
- Add
gha-creds-*.json
to your .gitignore file. - In IAM & Admin, grant
Service Account Token Creator
to the GitHub Actions principal: