Skip to content

Commit

Permalink
feat: deploy image in internal GCP registry (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmeds authored Jul 8, 2024
1 parent d1f768b commit c786ca2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
platform:
- linux/amd64
permissions:
contents: read
id-token: write
contents: write
packages: write

steps:
Expand All @@ -40,6 +41,22 @@ jobs:
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3

- name: "Authenticate to Google Cloud"
id: google-auth
uses: "google-github-actions/auth@v1"
with:
token_format: "access_token"
workload_identity_provider: "${{ secrets.GCP_PRD_GITHUB_WIF }}"
service_account: "${{ secrets.GCP_PRD_GITHUB_SA_DOCKER_REGISTRY }}"
create_credentials_file: true

- name: Login to the registry - production
uses: docker/login-action@v2
with:
registry: asia-docker.pkg.dev
username: oauth2accesstoken
password: "${{ steps.google-auth.outputs.access_token }}"

- name: Docker Login
uses: docker/login-action@v3
with:
Expand All @@ -59,6 +76,7 @@ jobs:
with:
images: |
zilliqa/otterscan
asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-public/otterscan
tags: |
type=ref,enable=false,priority=600,prefix=pr-,suffix=,event=pr
type=ref,event=branch
Expand Down

0 comments on commit c786ca2

Please sign in to comment.