Code Monkey home page Code Monkey logo

github-action-skaffold's Introduction

Skaffold Github Action

Code in src is autogenerated as build outcome from @hiberbee/actions repository, which combines various DevOps Github Actions. If you would like to contribute, create PR in that repository.

License GitHub Action Status GitHub Workflow Version

Skaffold is a command line tool that facilitates continuous development for Kubernetes applications. You can iterate on your application source code locally then deploy to local or remote Kubernetes clusters. Skaffold handles the workflow for building, pushing and deploying your application. It also provides building blocks and describe customizations for a CI/CD pipeline.

This action allows you to execute skaffold commands as Github Action. Repository is self-testable, so you can refer to Skaffold manifest, Container Structure tests and Github workflow

Installed versions

  • skaffold 1.38.0
  • container-structure-test 1.11.0

Inputs

Required

Optional

Name Description Default
skaffold-version Set Skaffold version 1.39.2
container-structure-test-version Set Container Structure Test version 1.11.0
kubectl-version Set Kubernetes CLI version 1.25.0
working-directory Set current working directory similar to Github Actions run ${{ github.workspace }}
filename Path or URL to the Skaffold config file skaffold.yaml
command Default command for Skaffold to execute diagnose
file-output Filename to write build images to n/a
repository Default repository value (overrides global config) n/a
insecure-registries Target registries for built images which are not secure n/a
image Set Skaffold profile name n/a
tag The optional custom tag to use for images which overrides the current Tagger configuration n/a
push Push the built images to the specified image repository n/a
concurrency Number of concurrently running builds. If equals 0 (default) - will run all builds in parallel n/a
kube-context Deploy to this Kubernetes context n/a
kubeconfig Path to the kubeconfig file to use for CLI requests n/a
namespace Run deployments in the specified namespace n/a
profile Activate profiles by name n/a
output Format output with go-template n/a
skip-tests Whether to skip the tests after building true
cache Set to false to disable default caching of artifacts true
cache-file Specify the location of the cache file n/a

Outputs

Name Description Payload
builds Built image tags [{ "imageName": "string", tag: "string"}]

Example

Build Docker images

jobs:
  pipeline:
    name: Skaffold Docker build
    runs-on: ubuntu-20.04
    steps:
      - name: Build Docker images
        uses: hiberbee/[email protected]
        with:
          command: build
          repository: ghcr.io/hiberbee/docker
          image: nodejs
          tag: ${{ github.sha }}

See more complex example with build, test & deployment simple Helm chart from Dockerfile to local K8S mini cluster.

name: Skaffold
on:
  push:
    paths:
      - src/**
      - .github/workflows/ci.yml
      - action.yml
jobs:
  pipeline:
    name: Skaffold Pipeline
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout sources
        uses: actions/checkout@v3

      - name: Setup Minikube
        uses: hiberbee/[email protected]

      - name: Setup Helm
        uses: hiberbee/[email protected]
        with:
          repository-config: test/repositories.yaml

      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          registry: ${{ secrets.DOCKER_REGISTRY }}
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Run Skaffold pipeline as action
        uses: hiberbee/[email protected]
        with:
          command: run
          repository: ghcr.io/${{ github.repository }}

      - name: Get Helm releases
        run: helm list

CLI usage

You can use that action just to set up Skaffold and then perform actions manually. Here is code sample:

github-action-skaffold's People

Contributors

vladyslavvolkov avatar dependabot[bot] avatar matt-rev avatar akshaychopra5207 avatar milanvanschaik avatar

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.