GitHub Action
Krane
v1.5
Latest version
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.
steps:
- uses: actions/checkout@v2
- uses: krane/action@master
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 |
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
- uses: krane/action@master
with:
url: ${{ secrets.KRANE_URL }}
token: ${{ secrets.KRANE_TOKEN }}
file: ./deployment.json
This GitHub action is written in TypeScript using the @krane/common
library to interact with the Krane API.