🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 kürzlich 5 Min Lesezeit
0

Deploying to Google Cloud Run with Github Actions: A Step-by-Step Guide

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht




What is Google Cloud Run?




Google Cloud Run is a serverless container platform that enables developers to run applications in a fully managed environment. It allows you to deploy stateless containers on a pay-as-you-go basis and auto-scales your application based on incoming traffic.







What is Github Actions?




GitHub Actions is a powerful workflow automation tool that allows developers to automate their development workflows. It integrates well with Google Cloud Run, making it easy to deploy applications from GitHub to Cloud Run.




In this article, I will be deploying a containerized web application to Google Cloud Run using GitHub Actions.



NOTE: If you want to use Gitlab CI/CD instead of GitHub Actions, see my other article .

  • Click on the project dropdown menu and select “New Project”.

  • Give your project a name and click “Create”.

  • Once your project is created, click on the “Activate Cloud Shell” button on the top right corner of the page.

  • Run the following command to enable the Cloud Run API:


  • CODE
    gcloud services enable run.googleapis.com






    An alternative way to enable Cloud Run API



    1. Go to the Google Cloud Console and select your project.

    2. In the left navigation menu, click on “APIs & Services” and then “Dashboard.”

    3. Click on the “+ ENABLE APIS AND SERVICES” button.

    4. Search for “Cloud Run API” and click on it.

    5. Click the “Enable” button.




    Step 2: Create a Dockerfile



    Next, we need to create a Dockerfile for our application. This file will contain instructions on how to build a container image for our application.



    Here’s an example Dockerfile for a Node.js application:




    CODE
    \# Use the official Node.js image  
    FROM node:14-alpine

    \# Set the working directory
    WORKDIR /app

    \# Copy the package.json and package-lock.json files
    COPY package\*.json ./

    \# Install the dependencies
    RUN npm install --production

    \# Copy the rest of the application code
    COPY . .

    \# Expose port 8080
    EXPOSE 8080

    \# Start the application
    CMD \["npm", "start"\]






    Save this file in the root directory of your project.






    Step 3: Build and test the container locally



    Before deploying our container to Google Cloud Run, let’s build and test it locally. Run the following command to build the container image:




    CODE
    docker build -t <your-image-name> .






    Replace <your-image-name> with a name for your container image. Once the build is complete, run the container with the following command:




    CODE
    docker run -p 8080:8080 <your-image-name>






    This will start the container and map port 8080 on your local machine to port 8080 inside the container. Open your web browser and go to http://localhost:8080 to test your application.






    Step 4: Set up GitHub Actions



    GitHub Actions is a powerful tool that allows you to automate your software development workflows. In this step, we will be creating a GitHub Actions workflow to build and deploy our container to Google Cloud Run.



    1. In your GitHub repository, click on the “Actions” tab.

    2. Click on the “Set up a workflow yourself” button.

    3. Replace the contents of the file with the following code:


    CODE
    name: "Deploy to Google Cloud Run"  

    on:
    push:
    branches:
    - main

    jobs:
    deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
    uses: actions/checkout@v2

    - name: Set up Google Cloud SDK
    uses: google-github-actions/setup-gcloud@master
    with:
    project\_id: <your-project-id>
    service\_account\_key: ${{ secrets.GCP\_SA\_KEY }}
    export\_default\_credentials: true

    - name: Configure docker for GCP
    run: gcloud auth configure-docker

    - name: Build and push Docker image
    uses: docker/build-push-action@v2
    with:
    context: .
    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






    Replace <your-project-id>, <your-image-name>, <your-service-name>, and <your-region> with your own values.



    You can see more here on how to use the google cloud run github actions.



    4. Click on the “Start commit” button and commit the changes to the repository.






    Step 5: Deploy to Google Cloud Run



    Once the GitHub Actions workflow completes successfully, your container should be deployed to Google Cloud Run. To verify that your application is running, go to the Google Cloud Console, select your project, and click on “Cloud Run” in the sidebar. You should see your service listed there.



    Click on the service to view its details, including the URL for your application. Open this URL in your web browser to test your deployed application.



    Congratulations! You have successfully deployed a containerized web application to Google Cloud Run using GitHub Actions.



    If you liked this article, please leave a clap or even a comment and don’t forget to follow me to get updated when I publish another one. Thanks!

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    1 Quelle
    Hackers Just Poisoned the Rust Supply Chain | Threat Wire
    1 Quelle
    Hackers Found a Way Into Humanoid Robots | Threat Wire
    1 Quelle
    Bits und so #1021 (Passwort für Laufwerk)
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten Deploying to Google Cloud Run with Github Actions: A Step-by-Step Guide

    Thematisch verwandte Begriffe: Deploying, Google, Cloud, with · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...