generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (48 loc) · 1.51 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
name: Build and publish to ghcr.io
on:
- push
env:
image: ghcr.io/shivjm/helm-kubeconform-action
go: "1.19.2"
helm: "v3.10.1"
schema: "master"
kubeconform: "v0.4.14"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login 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 }}
tools.kubeconform.version=${{ env.kubeconform }}
kubernetes.schema.version=${{ env.schema }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GO_VERSION=${{ env.go }}
KUBECONFORM_VERSION=${{ env.kubeconform }}
HELM_VERSION=${{ env.helm }}
SCHEMA_REVISION=${{ env.schema }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}"