Workflow file: .github/workflows/google-cloud-run-graalvm.yml
For pushes to the master
branch, the workflow will:
- Setup the build environment with respect to the selected java/graalvm version.
- Setup of Google Cloud CLI.
- Authenticate docker to use Google Container Registry (GCR).
- Build, tag and push Docker image with Micronaut application to GCR.
- Deploy Google Cloud Run application.
Add the following GitHub secrets:
Name | Description |
---|---|
GCLOUD_PROJECT_ID | Project id. |
GCLOUD_SA_KEY | Service account key file. See more on Creating and managing service accounts and Deployment permissions for CloudRun |
GCLOUD_IMAGE_REPOSITORY | (Optional) Docker image repository in GCR. For image [GCLOUD_REGION]/[GCLOUD_PROJECT_ID]/foo/bar:0.1 , the foo is an image repository. |
The workflow file also contains additional configuration options that are now configured to:
Name | Description | Default value |
---|---|---|
GCLOUD_REGION | Region where the Cloud Run application will be created. See Cloud Run Release Notes to find out what regions are supported. | europe-west3 |
GCLOUD_GCR | Google Container Registry url. See Overview of Container Registry to find out valid GCR endpoints. | eu.gcr.io |
From the workflow step Deploy Cloud Run
copy out url https://demo-__________run.app
of the invoke endpoint:
Invoke endpoint:
https://demo-__________run.app
Call the api endpoint:
curl https://demo-__________run.app/demo
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/components/server/build/classes/java/main/META-INF/swagger/zaps-list-0.0.1.yml \
-g typescript-angular \
-o /local/components/js-client