diff --git a/ReadMe.md b/ReadMe.md index 044bd6f..63baf5a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -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` @@ -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 ``` @@ -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 diff --git a/action.yml b/action.yml index af1a3a9..549bddd 100644 --- a/action.yml +++ b/action.yml @@ -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: diff --git a/entrypoint.sh b/entrypoint.sh index 88edc05..9806912 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 ################################################### @@ -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" diff --git a/example/build.yml b/example/build.yml index cb87989..bafc583 100644 --- a/example/build.yml +++ b/example/build.yml @@ -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 \ No newline at end of file diff --git a/example/build_all_option.yml b/example/build_all_option.yml index a8ed38a..8436a83 100644 --- a/example/build_all_option.yml +++ b/example/build_all_option.yml @@ -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 diff --git a/example/build_only_tags.yml b/example/build_only_tags.yml index 31f3d6c..a7a5836 100644 --- a/example/build_only_tags.yml +++ b/example/build_only_tags.yml @@ -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 \ No newline at end of file diff --git a/test/ReadMe.md b/test/ReadMe.md index 1353653..1928582 100644 --- a/test/ReadMe.md +++ b/test/ReadMe.md @@ -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. \ No newline at end of file diff --git a/test/build.yml b/test/build.yml index 5cd7bb1..eb64bd1 100644 --- a/test/build.yml +++ b/test/build.yml @@ -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