Giter Site home page Giter Site logo

sky9723 / example-gcloud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from baptistedixneuf/example-gcloud

0.0 2.0 0.0 8 KB

An example workflow, using the GitHub Action, to deploy a static website to an existing Google Kubernetes Engine Cluster

License: Creative Commons Zero v1.0 Universal

HCL 53.90% Dockerfile 2.94% HTML 43.16%

example-gcloud's Introduction

Google Cloud - GitHub Action Example

An example workflow, using the GitHub Action for gcloud to deploy a static website to an existing Google Kubernetes Engine Cluster.

Workflow

The example workflow will trigger on every push to this repo.

For pushes to the feature branch, the workflow will:

  1. Build the Docker image
  2. Verify the Google Cloud Platform credentials are correct

For pushes to the default branch (master), in addition to the above Actions, the workflow will:

  1. Build the Docker image
  2. Verify the Google Cloud Platform credentials are correct
  3. Tag and Push the image to Google Container Registry
    • The image is available through the following tags: latest, the branch name, and first 8 of the commit SHA
    • gcloud serves as a credential helper for Docker. This workflow registers gcloud as a credential helper and uses the 'docker' command within the gcloud action to push the image.
  4. Use a Kubernetes Deployment to push an image to the Cluster
    • Note that a GKE deployment requires a unique Tag to update the pods. Using a constant tag latest or a branch name master may result in successful workflows that don't update the cluster.

Requirements

  1. Google Cloud Platform project
  2. GCP Service Account with write access to GCR and GKE for this project
  3. GCP Service Account credentials stored as a JSON key.
    1. The GCLOUD_AUTH secret, used by the gcloud-auth action, requires that this is base64 encoded
  4. An existing Kubernetes Engine cluster
    1. Create a Cluster

License

This repository is licensed under CC0-1.0, which waives all copyright restrictions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.