{"id":23096499,"url":"https://github.com/dmsi-io/gha-cloudrun-deploy","last_synced_at":"2025-04-03T19:43:04.494Z","repository":{"id":42567607,"uuid":"472397475","full_name":"dmsi-io/gha-cloudrun-deploy","owner":"dmsi-io","description":"Deploys code to Google Cloud Run","archived":false,"fork":false,"pushed_at":"2022-11-29T17:23:17.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-03T00:59:36.589Z","etag":null,"topics":["deploy","deployment","github-actions","google-cloud-platform"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmsi-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-03-21T15:26:51.000Z","updated_at":"2022-07-28T19:14:45.000Z","dependencies_parsed_at":"2023-01-21T11:39:06.880Z","dependency_job_id":null,"html_url":"https://github.com/dmsi-io/gha-cloudrun-deploy","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.21052631578947367","last_synced_commit":"8c0d83540c14e9b83716865376c50c716b907d6a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsi-io%2Fgha-cloudrun-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsi-io%2Fgha-cloudrun-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsi-io%2Fgha-cloudrun-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmsi-io%2Fgha-cloudrun-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmsi-io","download_url":"https://codeload.github.com/dmsi-io/gha-cloudrun-deploy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070713,"owners_count":20878580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy","deployment","github-actions","google-cloud-platform"],"created_at":"2024-12-16T22:35:19.545Z","updated_at":"2025-04-03T19:43:04.466Z","avatar_url":"https://github.com/dmsi-io.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GHA Cloud Run Deploy\n\n[![actions-workflow-main][actions-workflow-main-badge]][actions-workflow-main]\n[![release][release-badge]][release]\n\nThis GitHub Action is a composite action that facilitates deployments and feature branch deployments to Google Cloud Run.\n\nThis action is dependent on a valid Dockerfile existing at the top level of the acting repository. The example in this repo is a simple nginx image, but it is expected that repos using this action will perform their own prior build steps and rely on this action to build and publish the Docker image.\n\nNormal push commit triggers will deploy the application as the new latest branch and will receive all traffic. Because of this, it recommended to only run this action for push commits to the default branch of the repo.\n\nTo make use of the feature branches, use this action with a pull_request trigger. This will allow the Cloud Run deployment to add a new tagged release corresponding to the PR number and will also provide a deployment URL that can be commented onto the PR.\n\n\u003e Examples of this can be found in: [.github/workflows/main.yml](.github/workflows/main.yml).\n\n## Inputs\n\n| NAME                    | DESCRIPTION                              | TYPE      | REQUIRED | DEFAULT  |\n| ----------------------- | ---------------------------------------- | --------- | -------- | -------- |\n| `GCP_IDENTITY_PROVIDER` | GCP Workload Identity Provider.          | `string`  | `true`\\* |          |\n| `GCP_SERVICE_ACCOUNT`   | GCP Service Account email.               | `string`  | `true`\\* |          |\n| `GCP_SA_KEY`            | GCP Service Account Key (JSON).          | `string`  | `true`\\* |          |\n| `GCP_PROJECT_ID`        | GCP Project ID.                          | `string`  | `true`   |          |\n| `REGISTRY_HOSTNAME`     | Hostname of Container Registry.          | `string`  | `false`  | `gcr.io` |\n| `port`                  | Port of Docker image to receive traffic. | `integer` | `false`  | `80`     |\n\n\u003e It is recommended to use Workload Identity Federation with the `GCP_IDENTITY_PROVIDER` and `GCP_SERVICE_ACCOUNT` inputs. `GCP_SA_KEY` will still work with `v1` tags.\n\n## Outputs\n\n| NAME  | DESCRIPTION                          | TYPE     |\n| ----- | ------------------------------------ | -------- |\n| `url` | The URL to the deployed application. | `string` |\n\n## Example\n\n```yaml\nname: Google Cloud Run Revision Deploy\non:\n  pull_request:\n  push:\n    branches:\n      - main\n\njobs:\n  build-deploy:\n    name: Build and Deploy to Cloud Run\n    runs-on: ubuntu-latest\n\n    permissions:\n      contents: 'read'\n      id-token: 'write'\n\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v2\n\n      # any pre-docker build steps will be placed here\n\n      - name: Run self\n        uses: dmsi-io/gha-cloudrun-deploy@main\n        id: deploy\n        with:\n          GCP_IDENTITY_PROVIDER: ${{ secrets.GCP_IDENTITY_PROVIDER }}\n          GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}\n          GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}\n```\n\n\u003e Workload Identity Federation requires access to the id-token permission and thus the outlined permissions in the example above are required.\n\n#### With Service Account Credentials JSON\n\n```yaml\nname: Google Cloud Run Revision Deploy\non:\n  pull_request:\n  push:\n    branches:\n      - main\n\njobs:\n  build-deploy:\n    name: Build and Deploy to Cloud Run\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v2\n\n      # any pre-docker build steps will be placed here\n\n      - name: Run self\n        uses: dmsi-io/gha-cloudrun-deploy@main\n        id: deploy\n        with:\n          GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}\n          GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}\n```\n\nFor a further practical example, see [.github/workflows/main.yml](.github/workflows/main.yml).\n\n\u003c!-- badge links --\u003e\n\n[actions-workflow-main]: https://github.com/dmsi-io/gha-cloudrun-deploy/actions/workflows/main.yml\n[actions-workflow-main-badge]: https://img.shields.io/github/workflow/status/dmsi-io/gha-cloudrun-deploy/Google%20Cloud%20Run%20Revision%20Deploy?label=Google%20Cloud%20Run%20Revision%20Deploy\u0026style=for-the-badge\u0026logo=github\n[release]: https://github.com/dmsi-io/gha-cloudrun-deploy/releases\n[release-badge]: https://img.shields.io/github/v/release/dmsi-io/gha-cloudrun-deploy?style=for-the-badge\u0026logo=github\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmsi-io%2Fgha-cloudrun-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmsi-io%2Fgha-cloudrun-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmsi-io%2Fgha-cloudrun-deploy/lists"}