File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 8484 channelId: live
8585` ` `
8686
87+ # ## Deploy using keyless authentication
88+
89+ Previous options require a service account JSON key to be stored as a string in the repo's "Secrets" area.
90+ You can authenticate vs. Google Cloud without the need for the JSON key using `auth` action :
91+
92+ ` ` ` yaml
93+ name: Deploy to Live Channel
94+
95+ on:
96+ push:
97+ branches:
98+ - main
99+ # Optionally configure to run only for specific files. For example:
100+ # paths:
101+ # - "website/**"
102+
103+ jobs:
104+ deploy_live_website:
105+ runs-on: ubuntu-latest
106+ steps:
107+ - uses: actions/checkout@v2
108+ - uses: google-github-actions/auth@v2
109+ with:
110+ token_format: 'access_token'
111+ workload_identity_provider: ${{ secrets.FIREBASE_IDENTITY_PROVIDER }}
112+ service_account: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_ID }}
113+ create_credentials_file: true
114+ - name: Read service account JSON into string
115+ run: |
116+ echo "SA_KEY_JSON=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
117+ - uses: FirebaseExtended/action-hosting-deploy@v0
118+ with:
119+ repoToken: "${{ secrets.GITHUB_TOKEN }}"
120+ firebaseServiceAccount: "${{ env.SA_KEY_JSON }}"
121+ projectId: your-Firebase-project-ID
122+ channelId: live
123+ ` ` `
124+
125+ The step by step instructions can be found in the [Google Cloud Blog post][blog].
126+
127+ The `FIREBASE_SERVICE_ACCOUNT_ID` should be the email of the `FIREBASE_SERVICE_ACCOUNT` service account.
128+ The `FIREBASE_IDENTITY_PROVIDER` should be the fully qualified resource name of the OIDC identity provider.
129+
130+ [blog] : https://cloud.google.com/blog/products/identity-security/enabling-keyless-authentication-from-github-actions
131+
87132# # Options
88133
89134# ## `firebaseServiceAccount` _{string}_ (required)
You can’t perform that action at this time.
0 commit comments