Add this in your action pipeline:
- name: Update Cloud Run Job
run: |
IMAGE_NAME=gcr.io/${{ secrets.GCP_PROJECT_ID }}/my-cloud-run-job
gcloud run jobs update my-cloud-run-job \
--image $IMAGE_NAME \
--region ${{ secrets.GCP_REGION }} \
--project ${{ secrets.GCP_PROJECT_ID }}
Answer from Sangeeta Yadav on Stack OverflowGitHub
github.com › google-github-actions › deploy-cloudrun
GitHub - google-github-actions/deploy-cloudrun: A GitHub Action for deploying services to Google Cloud Run. · GitHub
A GitHub Action for deploying services to Google Cloud Run. - google-github-actions/deploy-cloudrun
Starred by 583 users
Forked by 136 users
Languages TypeScript 95.4% | JavaScript 2.8% | Dockerfile 1.8%
Github actions to google cloud run takes about 7 mins. Is that normal?
I haven't worked with these particular GitHub Actions myself, but two things that you could try: Looking at google-github-actions/setup-gcloud, the latest version appears to be v2.1.1. ( https://github.com/google-github-actions/setup-gcloud/tags ). Perhaps it is worth trying v2.1.1 rather than v0.2.1 which is 3+ years old. Potentially, there are speed improvements there. For the Docker container building process, you'd have to review the Dockerfile and see whether you can perform any optimizations. Can you remove unnecessary dependencies? Can you utilize multi-stage builds to decrease the image size? ( https://docs.docker.com/build/building/multi-stage/ ) More on reddit.com
What is your CI workflow with Cloud Run ?
I use Cloud Build to test, build, and push the container to Artifact Registry - then use Cloud Deploy to handle deployment into dev, staging, prod. Haven’t felt the need to use anything from GitHub, Cloud Build has done everything for me. More on reddit.com
Videos
23:36
Continuous deployment to Google Cloud Run using GitHub Actions ...
11:49
Using GitHub Actions to Deploy My Website To Google Cloud - YouTube
12:20
Setup Github Actions for Cloud Run | Building a website with Strapi ...
23:19
Build and deploy to Cloud Run using GitHub Action - YouTube
04:44
Automate Deployments to GCP ☁️ Cloud Run 🏃 with GitHub Actions ...
10:57
How to deploy Cloud Run services with GitHub Actions - YouTube
Medium
azeezz.medium.com › from-code-to-cloud-github-actions-for-cloud-run-deployment-dc1304573642
From Code to Cloud: GitHub Actions for Cloud Run Deployment | by Azeez | Medium
April 7, 2024 - This article illustrates how to create a Github Actions workflow that builds a Docker image and pushes that image to Google Cloud Artifact Registry. In this article we will authenticate with a Service Account Key. We will be create a GCP SA which will be used for authentication between the GITHUB and the GCP services. And we grant the necessary permission to this SA so that it will deploy the GCP resources.
Top answer 1 of 2
1
Add this in your action pipeline:
- name: Update Cloud Run Job
run: |
IMAGE_NAME=gcr.io/${{ secrets.GCP_PROJECT_ID }}/my-cloud-run-job
gcloud run jobs update my-cloud-run-job \
--image $IMAGE_NAME \
--region ${{ secrets.GCP_REGION }} \
--project ${{ secrets.GCP_PROJECT_ID }}
2 of 2
0
- name: 'Name'
id: myid
uses: google-github-actions/deploy-cloudrun@v3
with:
project_id: ${{ env.PROJECT_ID }}
job: ${{ env.JOB_ID }}
region: ${{ env.REGION }}
image: ${{ env.IMAGE_NAME }}
flags: >
--service-account=${{ env.SERVICE_ACCOUNT }}
--execute-now
GitHub
github.com › google-github-actions › example-workflows › blob › main › workflows › create-cloud-deploy-release › cloud-deploy-to-cloud-run.yml
example-workflows/workflows/create-cloud-deploy-release/cloud-deploy-to-cloud-run.yml at main · google-github-actions/example-workflows
# and creates a release in Cloud Deploy using a declarative YAML Service · # specification (service-*.yaml) when a commit is pushed to the $default-branch branch. ... # 2. Create and configure Workload Identity Federation for GitHub (https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)
Author google-github-actions
Google Cloud
cloud.google.com › blog › products › devops-sre › using-github-actions-with-google-cloud-deploy
Using GitHub Actions with Google Cloud Deploy | Google Cloud Blog
May 9, 2023 - Deploy containers to Google Cloud with GitHub Actions and Google Cloud Deploy targets - Kubernetes, Anthos, and Cloud Run.
GitHub
github.com › google-github-actions › example-workflows › blob › main › workflows › deploy-cloudrun › cloudrun-docker.yml
example-workflows/workflows/deploy-cloudrun/cloudrun-docker.yml at main · google-github-actions/example-workflows
# This workflow build and push a Docker container to Google Artifact Registry and deploy it on Cloud Run when a commit is pushed to the $default-branch branch ... # 2. Create and configure Workload Identity Federation for GitHub (https://gi...
Author google-github-actions
GitHub
github.com › google-github-actions › deploy-cloudrun › releases
Releases · google-github-actions/deploy-cloudrun
February 1, 2025 - A GitHub Action for deploying services to Google Cloud Run. - google-github-actions/deploy-cloudrun
Author google-github-actions
GitHub
github.com › google-github-actions › create-cloud-deploy-release
GitHub - google-github-actions/create-cloud-deploy-release: A GitHub Action for creating releases via Cloud Deploy. · GitHub
The create-cloud-deploy-release GitHub Action creates a Cloud Deploy release to manage the deployment of an application to one or more Google Kubernetes Engine (GKE), Anthos, or Cloud Run targets.
Starred by 24 users
Forked by 7 users
Languages TypeScript 98.3% | JavaScript 1.7%
Pegasus
docs.saaspegasus.com › community › google-cloud-github-actions
Automating Deployment to Cloud Run using GitHub Actions | SaaS Pegasus
Go to your GitHub repository. Navigate to Settings > Secrets and variables > Actions. Click New repository secret and add the following secrets: GCP_DEPLOY_SA_KEY: The content of your cloud-run-deployer-key.json file. Copy the entire contents of the JSON file.
Google
docs.cloud.google.com › cloud run › run and scale self-hosted github runners on cloud run worker pools
Run and scale self-hosted GitHub runners on Cloud Run worker pools | Google Cloud Documentation
... Add self-hosted GitHub runners to support a GitHub repository, and create Secret Manager secrets to securely store tokens and secrets. Deploy a Cloud Run worker pool to Cloud Run and use the worker pool to accept jobs from GitHub actions.
Google
docs.cloud.google.com › cloud run › quickstart: deploy to cloud run from a git repository
Quickstart: Deploy to Cloud Run from a Git repository | Google Cloud Documentation
Check the confirmation agreement about GitHub and Google Cloud interactivity. Click Next. Under Build Type, select Google Cloud Buildpacks. Click Save. ... Confirm the name of the service. It will be automatically populated with the repository name. In the Region pulldown menu, select the region where you want your service located. Under Authentication, select Allow public access. If you don't have permissions (Cloud Run Admin role) to select this, the service will deploy and require authentication.
GitHub
github.com › google-github-actions › deploy-cloudrun › actions
Workflow runs · google-github-actions/deploy-cloudrun
A GitHub Action for deploying services to Google Cloud Run. - Workflow runs · google-github-actions/deploy-cloudrun
Author google-github-actions
GitHub
github.com › google-github-actions › example-workflows › blob › main › workflows › deploy-cloudrun › cloudrun-source.yml
example-workflows/workflows/deploy-cloudrun/cloudrun-source.yml at main · google-github-actions/example-workflows
# This workflow will deploy source code on Cloud Run when a commit is pushed to the $default-branch branch ... # 2. Create and configure Workload Identity Federation for GitHub (https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)
Author google-github-actions
LinkedIn
linkedin.com › pulse › deploying-containerized-web-apps-google-cloud-run-using-akinde
Deploying to Google Cloud Run with Github Actions: A Step-by-Step Guide
April 15, 2023 - push: true tags: gcr.io/<your-project-id>/<your-image-name>:latest build-args: | HTTP_PORT=8080 - name: Deploy to Cloud Run uses: google-github-actions/deploy-cloudrun@main with: image: gcr.io/<your-project-id>/<your-image-name>:latest service: <your-service-name> region: <your-region> platform: managed allow-unauthenticated: true env_vars: | FOO=bar ZIP=zap
Medium
medium.com › google-cloud › how-to-deploy-your-cloud-run-service-using-github-actions-e5b6a6f597a3
How to deploy your Cloud Run service using GitHub Actions | by Felipe Martinez | Google Cloud - Community | Medium
November 27, 2020 - Create a file on the folder .github/workflows/cloud-run-action.yaml inside your repo. Don’t forget to add the correct project ID. name: publish on: [push] jobs: build: name: Cloud Run Deployment runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@master - name: Setup GCP Service Account uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: version: 'latest' service_account_email: ${{ secrets.GCP_SA_EMAIL }} service_account_key: ${{ secrets.GCP_SA_KEY }} export_default_credentials: true - name: Configure Docker run: | gcloud auth configure-docker - name: Build run: | docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/helloworld:latest .