Skip to content

Commit ddf06e1

Browse files
authored
Merge pull request #22 from crazy-max/gar-example
Add example for Google Artifact Registry
2 parents adb7347 + 3b9e1f5 commit ddf06e1

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ___
2424
* [GitLab](#gitlab)
2525
* [Azure Container Registry (ACR)](#azure-container-registry-acr)
2626
* [Google Container Registry (GCR)](#google-container-registry-gcr)
27+
* [Google Artifact Registry (GAR)](#google-artifact-registry-gar)
2728
* [AWS Elastic Container Registry (ECR)](#aws-elastic-container-registry-ecr)
2829
* [Customizing](#customizing)
2930
* [inputs](#inputs)
@@ -162,6 +163,11 @@ jobs:
162163

163164
### Google Container Registry (GCR)
164165

166+
> [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+
165171
Use a service account with the ability to push to GCR and [configure access control](https://cloud.google.com/container-registry/docs/access-control).
166172
Then create and download the JSON key for this service account and save content of `.json` file
167173
[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:
187193
password: ${{ secrets.GCR_JSON_KEY }}
188194
```
189195

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+
190226
### AWS Elastic Container Registry (ECR)
191227

192228
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

Comments
 (0)