forked from shivjm/helm-kubeconform-action
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.02 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and publish to ghcr.io
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
IMAGE: ghcr.io/${{ github.repository }}
HELM_VERSION: v3.9.4
K8S_SCHEMA_UPSTREAM: "master"
KUBECONFORM_VERSION: "v0.4.14"
GO_VERSION: "1.19.2"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: sanitize version
run: |
VERSION=${{github.ref_name}}
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
- name: zLogin to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE }}
labels: |
tools.helm.version=${{ env.HELM_VERSION }}
tools.kubeconform.version=${{ env.KUBECONFORM_VERSION }}
kubernetes.schema.version=${{ env.K8S_SCHEMA_UPSTREAM }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
KUBECONFORM_VERSION=${{ env.KUBECONFORM_VERSION }}
HELM_VERSION=${{ env.HELM_VERSION }}
SCHEMA_REVISION=${{ env.K8S_SCHEMA_UPSTREAM }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
# TODO: release binaries?
- name: Publish Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
README.md