Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check

GitHub Action

Krane

v1.1

Krane

check

Krane

Automate Krane deployments

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Krane

uses: krane/[email protected]

Learn more about this action in krane/action

Choose a version

Action

Marketplace

The Krane Github Action allows you to automate deployments using Krane.

Typically in your pipelines you'll have a build image step and a push image step. The last step ideally auto-deploying your apps in that same pipeline.

uses: krane/action@v1
with:
  url: ${{ secrets.KRANE_URL }}
  token: ${{ secrets.KRANE_TOKEN }}
  file: ./deployment.json
Input Description Required
url URL of the Krane instance true
token Token used for authenticated Krane requests true
file Path to Krane deployment config true

Complete Example

The following builds and publishes and image to Docker then deploys to Krane.

.github/workflows/deploy.yml

name: deploy

on:
  push:
    branches:
      - master

jobs:
  build-and-publish-to-docker:
    name: Publish Docker image
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          repository: my-repo/my-image
          tags: latest
  deploy-to-krane:
    name: Deploy to Krane
    needs: [build-and-publish-to-docker]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: my-github-repo
      - uses: krane/action@v1
        with:
          url: ${{ secrets.KRANE_URL }}
          token: ${{ secrets.KRANE_TOKEN }}
          file: ./deployment.json

Contributing

This GitHub action is written in TypeScript using the @krane/common library to interact with the Krane API.