@Roman's response helped to fix the issue if I wanted to build/push the docker image from my local machine; however, it didn't help when doing the same from inside github actions. I had to add the following steps to the github actions workflow file to fix the Docker authentication issue with GAR: more here
- name: 'Login to GAR'
uses: 'docker/login-action@v3'
with:
registry: ${{ env.REGION }}-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
Note: you need to replace the env/secret with your own of course.