@@ -30,22 +30,30 @@ Cloud Function. See the Authorization section below for more information.
30
30
## Usage
31
31
32
32
``` yaml
33
- steps :
34
- - uses : actions/checkout@v2
35
- - id : auth
36
- uses : google-github-actions/auth@v0.4.0
37
- with :
38
- workload_identity_provider : ' projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
39
- service_account : ' my-service-account@my-project.iam.gserviceaccount.com'
40
- - id : deploy
41
- uses : google-github-actions/deploy-cloud-functions@v0.6.0
42
- with :
43
- name : my-function
44
- runtime : nodejs10
45
-
46
- # Example of using the output
47
- - id : test
48
- run : curl "${{ steps.deploy.outputs.url }}"
33
+ jobs :
34
+ job_id :
35
+ permissions :
36
+ contents : ' read'
37
+ id-token : ' write'
38
+
39
+ steps :
40
+ - uses : actions/checkout@v2
41
+
42
+ - id : auth
43
+ uses : google-github-actions/auth@v0
44
+ with :
45
+ workload_identity_provider : ' projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
46
+ service_account : ' my-service-account@my-project.iam.gserviceaccount.com'
47
+
48
+ - id : deploy
49
+ uses : google-github-actions/deploy-cloud-functions@v0.7.0
50
+ with :
51
+ name : my-function
52
+ runtime : nodejs10
53
+
54
+ # Example of using the output
55
+ - id : test
56
+ run : curl "${{ steps.deploy.outputs.url }}"
49
57
` ` `
50
58
51
59
## Inputs
@@ -206,32 +214,46 @@ See [usage](https://github.com/google-github-actions/auth#usage) for more detail
206
214
# ### Authenticating via Workload Identity Federation
207
215
208
216
` ` ` yaml
209
- - uses: actions/checkout@v2
210
- - id: auth
211
- uses: google-github-actions/auth@v0.4.0
212
- with:
213
- workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
214
- service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
215
- - id: deploy
216
- uses: google-github-actions/deploy-cloud-functions@v0.6.0
217
- with:
218
- name: my-function
219
- runtime: nodejs10
217
+ jobs:
218
+ job_id:
219
+ permissions:
220
+ contents: 'read'
221
+ id-token: 'write'
222
+
223
+ steps:
224
+ - uses: actions/checkout@v2
225
+
226
+ - id: auth
227
+ uses: google-github-actions/auth@v0
228
+ with:
229
+ workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
230
+ service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
231
+
232
+ - id: deploy
233
+ uses: google-github-actions/deploy-cloud-functions@v0.7.0
234
+ with:
235
+ name: my-function
236
+ runtime: nodejs10
220
237
` ` `
221
238
222
239
# ### Authenticating via Service Account Key JSON
223
240
224
241
` ` ` yaml
225
- - uses: actions/checkout@v2
226
- - id: auth
227
- uses: google-github-actions/auth@v0.4.0
228
- with:
229
- credentials_json: ${{ secrets.gcp_credentials }}
230
- - id: deploy
231
- uses: google-github-actions/deploy-cloud-functions@v0.6.0
232
- with:
233
- name: my-function
234
- runtime: nodejs10
242
+ jobs:
243
+ job_id:
244
+ steps:
245
+ - uses: actions/checkout@v2
246
+
247
+ - id: auth
248
+ uses: google-github-actions/auth@v0
249
+ with:
250
+ credentials_json: ${{ secrets.gcp_credentials }}
251
+
252
+ - id: deploy
253
+ uses: google-github-actions/deploy-cloud-functions@v0.7.0
254
+ with:
255
+ name: my-function
256
+ runtime: nodejs10
235
257
` ` `
236
258
237
259
# ## Via Application Default Credentials
@@ -242,12 +264,16 @@ authenticate requests as the service account attached to the instance. **This
242
264
only works using a custom runner hosted on GCP.**
243
265
244
266
` ` ` yaml
245
- - uses: actions/checkout@v2
246
- - id: Deploy
247
- uses: google-github-actions/deploy-cloud-functions@v0.6.0
248
- with:
249
- name: my-function
250
- runtime: nodejs10
267
+ jobs:
268
+ job_id:
269
+ steps:
270
+ - uses: actions/checkout@v2
271
+
272
+ - id: Deploy
273
+ uses: google-github-actions/deploy-cloud-functions@v0.7.0
274
+ with:
275
+ name: my-function
276
+ runtime: nodejs10
251
277
` ` `
252
278
253
279
The action will automatically detect and use the Application Default
0 commit comments