Skip to content

Commit fa1cb37

Browse files
committedMar 31, 2021
Add documentation on how to use kubeconform as a Github Action
1 parent e4d5505 commit fa1cb37

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
 

‎Readme.md

+28
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,34 @@ $ ./scripts/openapi2jsonschema.py https://raw.githubusercontent.com/aws/amazon-s
193193
JSON schema written to trainingjob-sagemaker-v1.json
194194
```
195195

196+
### Usage as a Github Action
197+
198+
Kubeconform is publishes Docker Images to Github's new Container Registry, ghcr.io. These images
199+
can be used directly in a Github Action, once logged in using a [_Github Token_](https://github.blog/changelog/2021-03-24-packages-container-registry-now-supports-github_token/).
200+
201+
Example:
202+
```
203+
name: kubeconform
204+
on: push
205+
jobs:
206+
kubeconform:
207+
runs-on: ubuntu-latest
208+
steps:
209+
- name: login to Github Packages
210+
run: echo "${{ github.token }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin
211+
- uses: actions/checkout@v2
212+
- uses: docker://ghcr.io/yannh/kubeconform:master
213+
with:
214+
entrypoint: '/kubeconform'
215+
args: "-summary -output json kubeconfigs/"
216+
```
217+
218+
_Note on pricing_: Kubeconform relies on Github Container Registry which is currently in Beta. During that period,
219+
[bandwidth is free](https://docs.github.com/en/packages/guides/about-github-container-registry). After that period,
220+
bandwidth costs might be applicable. Since bandwidth from Github Packages within Github Actions is free, I expect
221+
Github Container Registry to also be usable for free within Github Actions in the future. If that were not to be the
222+
case, I might publish the Docker image to a different platform.
223+
196224
### Speed comparison with Kubeval
197225

198226
Running on a pretty large kubeconfigs setup, on a laptop with 4 cores:

0 commit comments

Comments
 (0)
Please sign in to comment.