Skip to content

Commit

Permalink
Merge pull request #3 from dodizzle/master
Browse files Browse the repository at this point in the history
move from using project_name to project_id
  • Loading branch information
RafikFarhad authored Jul 31, 2020
2 parents b272dab + d855813 commit d383c6d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The service account key of google cloud. The service accout json file must be en
### `registry`
The registry where the image should be pushed. Default `gcr.io`.

### `project_name`
### `project_id`
The project name. This field is required.

### `image_name`
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: my-awesome-project
project_id: my-awesome-project
image_name: server-end
```
Expand All @@ -75,7 +75,7 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: my-awesome-project
project_id: my-awesome-project
image_name: server-end
image_tag: ${{ steps.get_tag_name.outputs.GIT_TAG_NAME}}
dockerfile: ./build/Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ inputs:
description: The registry where the image should be pushed
required: false
default: gcr.io
project_name:
description: The project name
project_id:
description: The project id
required: true
default: my-awesome-project
image_name:
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#date :20200703
#version :2.0.0
#usage :./entrypoint.sh
#notes :Required env values are: INPUT_GCLOUD_SERVICE_KEY,INPUT_REGISTRY,INPUT_PROJECT_NAME,INPUT_IMAGE_NAME
#notes :Required env values are: INPUT_GCLOUD_SERVICE_KEY,INPUT_REGISTRY,INPUT_PROJECT_ID,INPUT_IMAGE_NAME
# Optional env values are: INPUT_IMAGE_TAG,INPUT_DOCKERFILE,INPUT_TARGET,INPUT_CONTEXT
#bash_version :5.0.17(1)-release
###################################################
Expand Down Expand Up @@ -54,7 +54,7 @@ fi

for IMAGE_TAG in ${ALL_IMAGE_TAG[@]}; do

IMAGE_NAME="$INPUT_REGISTRY/$INPUT_PROJECT_NAME/$INPUT_IMAGE_NAME:$IMAGE_TAG"
IMAGE_NAME="$INPUT_REGISTRY/$INPUT_PROJECT_ID/$INPUT_IMAGE_NAME:$IMAGE_TAG"

echo "Fully qualified image name: $IMAGE_NAME"

Expand Down
2 changes: 1 addition & 1 deletion example/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: my-awesome-project
project_id: my-awesome-project
image_name: server-end
2 changes: 1 addition & 1 deletion example/build_all_option.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: my-awesome-project
project_id: my-awesome-project
image_name: server-end
image_tag: latest,v1
dockerfile: ./docker/Dockerfile.prod
Expand Down
2 changes: 1 addition & 1 deletion example/build_only_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: my-awesome-project
project_id: my-awesome-project
image_name: server-end
image_tag: latest,${{ steps.get_tag_name.outputs.GIT_TAG_NAME }}
dockerfile: ./build/Dockerfile
2 changes: 1 addition & 1 deletion test/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ To test the action locally, [https://github.com/nektos/act](https://github.com/n
## Steps:

1. Create a `secret.txt` file with the `base64` representation of GCloud Service Account json key in `./test` folder.
2. Change `project_name`, `image_name`, `image_tag` in the `./test/build.yml` as your GCP project.
2. Change `project_id`, `image_name`, `image_tag` in the `./test/build.yml` as your GCP project.
2. Run `act -v -s GCLOUD_SERVICE_KEY="$(< test/secret.txt)" -W test/` from the repository root.
2 changes: 1 addition & 1 deletion test/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_name: source-code-oj
project_id: source-code-oj
image_name: push-to-gcr-action-test
image_tag: v2,latest
dockerfile: ./test/Dockerfile.test
Expand Down

0 comments on commit d383c6d

Please sign in to comment.