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
> [Google Artifact Registry](#google-artifact-registry-gar) is the evolution of Google Container Registry. As a
167
+
> fully-managed service with support for both container images and non-container artifacts. If you currently use
168
+
> Google Container Registry, use the information [on this page](https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr)
169
+
> to learn about transitioning to Google Artifact Registry.
170
+
165
171
Use a service account with the ability to push to GCR and [configure access control](https://cloud.google.com/container-registry/docs/access-control).
166
172
Then create and download the JSON key for this service account and save content of `.json` file
167
173
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
@@ -187,6 +193,36 @@ jobs:
187
193
password: ${{ secrets.GCR_JSON_KEY }}
188
194
```
189
195
196
+
### Google Artifact Registry (GAR)
197
+
198
+
Use a service account with the ability to push to GAR and [configure access control](https://cloud.google.com/artifact-registry/docs/access-control).
199
+
Then create and download the JSON key for this service account and save content of `.json` file
200
+
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
201
+
called `GAR_JSON_KEY` in your GitHub repo. Ensure you set the username to `_json_key`.
202
+
203
+
```yaml
204
+
name: ci
205
+
206
+
on:
207
+
push:
208
+
branches: master
209
+
210
+
jobs:
211
+
login:
212
+
runs-on: ubuntu-latest
213
+
steps:
214
+
-
215
+
name: Login to GAR
216
+
uses: docker/login-action@v1
217
+
with:
218
+
registry: <location>-docker.pkg.dev
219
+
username: _json_key
220
+
password: ${{ secrets.GAR_JSON_KEY }}
221
+
```
222
+
223
+
> Replace `<location>` with the regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repo-organize#locations)
224
+
> of the repository where the image is stored.
225
+
190
226
### AWS Elastic Container Registry (ECR)
191
227
192
228
Use an IAM user with the [ability to push to ECR](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html).
0 commit comments