You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+92-12Lines changed: 92 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ name: ci
39
39
40
40
on:
41
41
push:
42
-
branches: master
42
+
branches: main
43
43
44
44
jobs:
45
45
login:
@@ -64,7 +64,7 @@ name: ci
64
64
65
65
on:
66
66
push:
67
-
branches: master
67
+
branches: main
68
68
69
69
jobs:
70
70
login:
@@ -92,7 +92,7 @@ name: ci
92
92
93
93
on:
94
94
push:
95
-
branches: master
95
+
branches: main
96
96
97
97
jobs:
98
98
login:
@@ -118,7 +118,7 @@ name: ci
118
118
119
119
on:
120
120
push:
121
-
branches: master
121
+
branches: main
122
122
123
123
jobs:
124
124
login:
@@ -142,6 +142,45 @@ jobs:
142
142
> Google Container Registry, use the information [on this page](https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr)
143
143
> to learn about transitioning to Google Artifact Registry.
144
144
145
+
You can use either workload identity federation based keyless authentication or service account based authentication.
146
+
147
+
#### Workload identity federation based authentication
148
+
149
+
Configure the workload identity federation for github actions in gcloud (for steps, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)). In the steps, your service account should the ability to push to GCR. Then use google-github-actions/auth action for authentication using workload identity like below:
> Replace `<workload_identity_provider>` with configured workload identity provider. For steps to configure, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation).
179
+
180
+
> Replace `<service_account>` with configured service account in workload identity provider which has access to push to GCR
181
+
182
+
#### Service account based authentication
183
+
145
184
Use a service account with the ability to push to GCR and [configure access control](https://cloud.google.com/container-registry/docs/access-control).
146
185
Then create and download the JSON key for this service account and save content of `.json` file
147
186
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
@@ -152,7 +191,7 @@ name: ci
152
191
153
192
on:
154
193
push:
155
-
branches: master
194
+
branches: main
156
195
157
196
jobs:
158
197
login:
@@ -169,6 +208,47 @@ jobs:
169
208
170
209
### Google Artifact Registry (GAR)
171
210
211
+
You can use either workload identity federation based keyless authentication or service account based authentication.
212
+
213
+
#### Workload identity federation based authentication
214
+
215
+
Configure the workload identity federation for github actions in gcloud (for steps, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)). In the steps, your service account should the ability to push to GAR. Then use google-github-actions/auth action for authentication using workload identity like below:
> Replace `<workload_identity_provider>` with configured workload identity provider
244
+
245
+
> Replace `<service_account>` with configured service account in workload identity provider which has access to push to GCR
246
+
247
+
> Replace `<location>` with the regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repo-organize#locations)
248
+
> of the repository where the image is stored.
249
+
250
+
#### Service account based authentication
251
+
172
252
Use a service account with the ability to push to GAR and [configure access control](https://cloud.google.com/artifact-registry/docs/access-control).
173
253
Then create and download the JSON key for this service account and save content of `.json` file
174
254
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
0 commit comments