Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove creation of the extra check and add support for GAC paths #353

Closed
wants to merge 15 commits into from
Closed
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,51 @@ jobs:
channelId: live
```

### Deploy using keyless authentication

Previous options require a service account JSON key to be stored as a string in the repo's "Secrets" area.
You can authenticate vs. Google Cloud without the need for the JSON key using the [`auth` action](https://github.com/marketplace/actions/authenticate-to-google-cloud):

```yaml
name: Deploy to Live Channel

on:
push:
branches:
- main
# Optionally configure to run only for specific files. For example:
# paths:
# - "website/**"

jobs:
deploy_live_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ secrets.FIREBASE_IDENTITY_PROVIDER }}
service_account: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_ID }}
create_credentials_file: true
- name: Read service account JSON into string
run: |
echo "SA_KEY_JSON=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ env.SA_KEY_JSON }}"
projectId: your-Firebase-project-ID
channelId: live
```

The step by step instructions can be found in the [Google Cloud Blog post][blog].

The `FIREBASE_SERVICE_ACCOUNT_ID` should be the email of the `FIREBASE_SERVICE_ACCOUNT` service account.
The `FIREBASE_IDENTITY_PROVIDER` should be the fully qualified resource name of the OIDC identity provider.

[blog]: https://cloud.google.com/blog/products/identity-security/enabling-keyless-authentication-from-github-actions

## Options

### `firebaseServiceAccount` _{string}_ (required)
Expand Down
Loading