Coder Social home page Coder Social logo

ameydev / gke-kubectl-action Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 11.0 13 KB

A Github Action which can be used to authenticate with Google Cloud Kubernetes Engine.

License: MIT License

Dockerfile 23.60% Shell 76.40%
github-actions gke-cluster kubectl

gke-kubectl-action's Introduction

gke-kubectl-action

A Github Action which can be used to deploy your application by performing kubectl actions on the GKE cluster.

To use this action, make sure you have created a GCP service account having the necessary permissions given to it.

Secrets

APPLICATION_CREDENTIALS - To authorize in GCP you need to have a service account key. Required Base64 encoded service account key exported as JSON. To encode a JSON file use: base64 ~/<account_id>.json

PROJECT_ID - must be provided to activate a specific project.

Usage

Deploy your app when a release is created

name: Deploy App on GKE cluster.
on:
  release:
    types: [created]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: kubectl - Google Cloud GKE cluster.
      uses: ameydev/gke-kubectl-action@master
      env:
        PROJECT_ID: ${{ secrets.PROJECT_ID }}
        APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
        CLUSTER_NAME: ${{ secrets.GKE_CLUSTER_NAME }}
        ZONE_NAME: us-central1-c
      with:
        args: apply -f packaging/k8s/manifests/ -n prod

Deploy your app when a feature is merged to master

name: Deploy App on GKE cluster.
on:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: kubectl - Google Cloud GKE cluster.
      uses: ameydev/gke-kubectl-action@master
      env:
        PROJECT_ID: ${{ secrets.PROJECT_ID }}
        APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
        CLUSTER_NAME: ${{ secrets.GKE_CLUSTER_NAME }}
        ZONE_NAME: us-central1-c
      with:
        args: apply -f packaging/k8s/manifests/ -n staging

TODO:

  • Add github actions (Build and Release workflows.)
  • Exclude any yaml, wildcard for input
  • Update README (Different Paths, Exclude any yaml, wildcard for input)

gke-kubectl-action's People

Contributors

ameydev avatar dodizzle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gke-kubectl-action's Issues

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.