If you're also about to migrate from Container Registry into Artifact Registry and has to adapt your Github Actions pipelines to do so, the migration itself is very simple
steps:
...
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
# if you're using a .json for a service account
credentials_json: '${{ secrets.your-service-account-json }}'
# if you are using workload identity
token_format: access_token
workload_identity_provider: <provider-id>
service_account: <service-account>@<project-id>.iam.gserviceaccount.com
access_token_lifetime: 600s
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Use gcloud CLI
run: gcloud info
# if you're using a .json for a service account
- name: Login to Artifact Registry
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev
# if you are using workload identity
- name: Login to Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Docker build & push
run: |
# Build & push
docker build -t us-central1-docker.pkg.dev/<project-id>/<registry-name>/<image-name>:<tag> .
docker push us-central1-docker.pkg.dev/<project-id>/<registry-name>/<image-name>:<tag>
shell: bash