Skip to content

Commit 388254c

Browse files
author
JohnyDev
committed
Fix #192 github-actions-gcr
1 parent e7f14cc commit 388254c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Github-Actions/Docker_Img-GCR/.github/workflows/gcr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
- main
97

108
env:
119
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
@@ -20,7 +18,7 @@ jobs:
2018
uses: actions/checkout@v2
2119

2220
- name: Authenticate with Google Cloud
23-
uses: google-github-actions/setup-gcloud@master
21+
uses: google-github-actions/setup-gcloud@v1
2422
with:
2523
project_id: ${{ env.PROJECT_ID }}
2624
service_account_key: ${{ secrets.GCLOUD_AUTH }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build and Push Docker image to GCR
2+
3+
This github actions workflow is to build and push docker image to GCR
4+
5+
### Step 1: Create `Project` on GCP
6+
7+
### Step 2: Create a `Service Account` with the permission `Storage Object Creator`
8+
9+
### Step 3: Create `Key` using the created service account
10+
11+
### Step 4: Navigate to `GitHub Secrets` and add the `JSON` file you get from the created `Key`
12+
13+
Example of the secret name `GCLOUD_AUTH`
14+
15+
`NOTE:` Make sure the `Container Registry API` are enabled

0 commit comments

Comments
 (0)